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: BufferQueueImplementations§
Source§impl<Sink: TreeSink> Parser<Sink>
impl<Sink: TreeSink> Parser<Sink>
Sourcepub fn from_utf8(self) -> Utf8LossyDecoder<Self>
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.
fn loop_until_done(&self)
Trait Implementations§
Source§impl<Sink: TreeSink> TendrilSink<UTF8> for Parser<Sink>
impl<Sink: TreeSink> TendrilSink<UTF8> for Parser<Sink>
Source§fn process(&mut self, t: StrTendril)
fn process(&mut self, t: StrTendril)
Process this tendril.
Source§fn from_iter<I>(self, i: I) -> Self::Output
fn from_iter<I>(self, i: I) -> Self::Output
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>
impl<Sink> UnwindSafe for Parser<Sink>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more