Struct html5ever::driver::Parser

source ·
pub struct Parser<Sink>
where Sink: TreeSink,
{ pub tokenizer: Tokenizer<TreeBuilder<Sink::Handle, Sink>>, pub input_buffer: BufferQueue, }
Expand description

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

Fields§

§tokenizer: Tokenizer<TreeBuilder<Sink::Handle, Sink>>§input_buffer: BufferQueue

Implementations§

source§

impl<Sink: TreeSink> Parser<Sink>

source

pub fn from_utf8(self) -> Utf8LossyDecoder<Self>

Wrap this parser into a TendrilSink that accepts UTF-8 bytes.

Use this when your input is bytes that are known to be in the UTF-8 encoding. Decoding is lossy, like String::from_utf8_lossy.

Trait Implementations§

source§

impl<Sink: TreeSink> TendrilSink<UTF8> for Parser<Sink>

source§

type Output = <Sink as TreeSink>::Output

What the overall result of processing is.
source§

fn process(&mut self, t: StrTendril)

Process this tendril.
source§

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

Indicates that an error has occurred.
source§

fn finish(self) -> Self::Output

Indicates the end of the stream.
source§

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

Process one tendril and finish.
source§

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

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

Auto Trait Implementations§

§

impl<Sink> !Freeze for Parser<Sink>

§

impl<Sink> !RefUnwindSafe for Parser<Sink>

§

impl<Sink> !Send for Parser<Sink>

§

impl<Sink> !Sync for Parser<Sink>

§

impl<Sink> Unpin for Parser<Sink>
where Sink: Unpin, <Sink as TreeSink>::Handle: Unpin,

§

impl<Sink> UnwindSafe for Parser<Sink>
where Sink: UnwindSafe, <Sink as TreeSink>::Handle: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.