Trait tendril::stream::TendrilSink [] [src]

pub trait TendrilSink<F, A> where F: Format, A: Atomicity {
    fn process(&mut self, t: Tendril<F, A>);
    fn error(&mut self, desc: Cow<'static, str>);

    fn finish(&mut self) { ... }
}

Trait for types that can process a tendril.

This is a "push" interface, unlike the "pull" interface of Iterator<Item=Tendril<F>>. The push interface matches html5ever and other incremental parsers with a similar architecture.

Required Methods

fn process(&mut self, t: Tendril<F, A>)

Process this tendril.

fn error(&mut self, desc: Cow<'static, str>)

Indicates that an error has occurred.

Provided Methods

fn finish(&mut self)

Indicates the end of the stream.

By default, does nothing.

Implementors