pub struct HeadParser { /* private fields */ }Expand description
Incrementally parses an HTML stream, separating the <head> from the
<body>. Feed chunks via HeadParser::feed until HeadParser::complete
returns true, then call HeadParser::head and HeadParser::take_body.
Also detects whether the input is HTML at all: if the first non-whitespace
character is not < the document is treated as plain text.
Implementations§
Source§impl HeadParser
impl HeadParser
pub fn new() -> Self
Sourcepub fn feed(&mut self, data: &str) -> bool
pub fn feed(&mut self, data: &str) -> bool
Feed the next chunk of input. Returns true once the body has started
(i.e. HeadParser::complete would return true).
Sourcepub fn is_html(&self) -> bool
pub fn is_html(&self) -> bool
True if the input looks like HTML (first non-whitespace char is <).
Trait Implementations§
Source§impl Debug for HeadParser
impl Debug for HeadParser
Source§impl Default for HeadParser
impl Default for HeadParser
Source§fn default() -> HeadParser
fn default() -> HeadParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HeadParser
impl RefUnwindSafe for HeadParser
impl Send for HeadParser
impl Sync for HeadParser
impl Unpin for HeadParser
impl UnsafeUnpin for HeadParser
impl UnwindSafe for HeadParser
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