Skip to main content

TokenSink

Trait TokenSink 

Source
pub trait TokenSink {
    type Handle;

    // Required method
    fn process_token(
        &self,
        token: Token,
        line_number: u64,
    ) -> TokenSinkResult<Self::Handle>;

    // Provided methods
    fn end(&self) { ... }
    fn adjusted_current_node_present_but_not_in_html_namespace(&self) -> bool { ... }
}
Expand description

Types which can receive tokens from the tokenizer.

Required Associated Types§

Source

type Handle

The type of a DOM node.

Required Methods§

Source

fn process_token( &self, token: Token, line_number: u64, ) -> TokenSinkResult<Self::Handle>

Process a token.

Provided Methods§

Source

fn end(&self)

Signal that tokenization reached the end of the document.

Source

fn adjusted_current_node_present_but_not_in_html_namespace(&self) -> bool

Used in the markup declaration open state. By default, this always returns false and thus all CDATA sections are tokenized as bogus comments.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Handle, Sink> TokenSink for TreeBuilder<Handle, Sink>
where Handle: Clone, Sink: TreeSink<Handle = Handle>,

Source§

type Handle = Handle