pub struct Document<'a> { /* private fields */ }Expand description
An immutable source-order document with borrowed strings.
Each emitted start tag creates an element. An end tag closes the innermost open element with that name and its descendants; unmatched end tags are ignored. HTML void elements close immediately. The self-closing flag on other HTML elements is ignored. Remaining elements close at EOF. No elements are implied, relocated, or cloned: this is not the HTML browser tree-building algorithm.
Construction, traversal, and destruction use flat storage without recursion.
Implementations§
Source§impl<'a> Document<'a>
impl<'a> Document<'a>
Sourcepub fn parse(source: &'a str) -> Result<Self, Error>
pub fn parse(source: &'a str) -> Result<Self, Error>
Parse a document with the default resource limits.
Auto Trait Implementations§
impl<'a> Freeze for Document<'a>
impl<'a> RefUnwindSafe for Document<'a>
impl<'a> Send for Document<'a>
impl<'a> Sync for Document<'a>
impl<'a> Unpin for Document<'a>
impl<'a> UnsafeUnpin for Document<'a>
impl<'a> UnwindSafe for Document<'a>
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