Struct html5ever::driver::BytesParser [] [src]

pub struct BytesParser<Sink> where Sink: TreeSink {
    // some fields omitted
}

An HTML parser, ready to recieve bytes input through the tendril::TendrilSink trait’s methods.

See Parser::from_bytes.

Methods

impl<Sink: TreeSink> BytesParser<Sink>
[src]

fn str_parser(&self) -> &Parser<Sink>

Access the underlying Parser

fn str_parser_mut(&mut self) -> &mut Parser<Sink>

Access the underlying Parser

fn process_unicode(&mut self, t: StrTendril)

Insert a Unicode chunk in the middle of the byte stream.

This is e.g. for supporting document.write.

Trait Implementations

impl<Sink: TreeSink> TendrilSink<Bytes> for BytesParser<Sink>
[src]

fn process(&mut self, t: ByteTendril)

Process this tendril.

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

Indicates that an error has occurred.

type Output = Sink::Output

What the overall result of processing is.

fn finish(self) -> Self::Output

Indicates the end of the stream.

fn one<T>(self, t: T) -> Self::Output where T: Into<Tendril<F, A>>

Process one tendril and finish.

fn from_iter<I>(self, i: I) -> Self::Output where I: IntoIterator, I::Item: Into<Tendril<F, A>>

Consume an iterator of tendrils, processing each item, then finish.

fn read_from<R>(self, r: &mut R) -> Result<Self::Output, Error> where F: SliceFormat<Slice=[u8]>, R: Read

Read from the given stream of bytes until exhaustion and process incrementally, then finish. Return Err at the first I/O error. Read more

fn from_file<P>(self, path: P) -> Result<Self::Output, Error> where F: SliceFormat<Slice=[u8]>, P: AsRef<Path>

Read from the file at the given path and process incrementally, then finish. Return Err at the first I/O error. Read more