README

bobzhang/html_parser/stream does not have a README file

#
StreamDoctypeEvent

pub(all) struct StreamDoctypeEvent {
name : String
public_id : String?
system_id : String?
} derive(Eq,
Debug
)

Doctype event emitted by the streaming tokenizer facade.

#
StreamEvent

pub(all) enum StreamEvent {
StreamStart(StreamStartEvent)
StreamText(String)
StreamEnd(String)
StreamComment(String)
StreamDoctype(StreamDoctypeEvent)
} derive(Eq,
Debug
)

Token-level streaming event.

The stream API does not build a DOM tree. It forwards start tags, end tags, text, comments, and doctypes in tokenizer order, coalescing adjacent text.

#
StreamSink

pub struct StreamSink {
// private fields
} derive(
Debug
)

Mutable sink that converts tokenizer tokens into coalesced stream events.

#
StreamSink::drain

fn StreamSink::drain(self : StreamSink) -> Array[StreamEvent]

Drain buffered events from this sink.

Pending character data is flushed before the returned array is copied, and the sink is empty afterward.

#
StreamSink::drain_each

fn StreamSink::drain_each(self : StreamSink, emit : (StreamEvent) -> Unit) -> Unit

Drain buffered events by invoking emit for each event.

Pending character data is flushed first, and the sink is empty afterward.

#
StreamSink::new

fn StreamSink::new() -> StreamSink

Create an empty stream sink.

#
StreamSink::process_characters

fn StreamSink::process_characters(self : StreamSink, data : String) -> Unit

Buffer character data until the next structural token or drain.

#
StreamSink::process_token

Process one tokenizer token into this sink.

Character tokens are buffered and adjacent text is emitted as a single StreamText event. Non-text tokens flush pending text first.

#
StreamStartEvent

pub(all) struct StreamStartEvent {
name : String
attrs : Map[String, String?]
} derive(Eq,
Debug
)

Start-tag event emitted by the streaming tokenizer facade.

name is the normalized tag name and attrs contains the decoded attributes for the tag.

#
stream

fn stream(html : StringView) -> Array[StreamEvent]

Parse an HTML string into streaming events.

#
stream_bytes

fn stream_bytes(input : BytesView, encoding? : String) -> Array[StreamEvent]

Decode HTML bytes and return streaming events.

When encoding is omitted, the same byte-sniffing path used by parse_bytes chooses the input encoding.

#
stream_bytes_each

fn stream_bytes_each(input : BytesView, emit : (StreamEvent) -> Unit, encoding? : String) -> Unit

Decode HTML bytes and emit streaming events incrementally.

When encoding is omitted, the same byte-sniffing path used by parse_bytes chooses the input encoding.

#
stream_each

fn stream_each(html : StringView, emit : (StreamEvent) -> Unit) -> Unit

Parse an HTML string and emit streaming events incrementally.

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io