pub struct Doc<'a> { /* private fields */ }Expand description
The document a query runs over: its tree and the tree’s index.
Implementations§
Source§impl<'a> Doc<'a>
impl<'a> Doc<'a>
Sourcepub fn new(tree: &'a dyn Tree, index: &'a Index) -> Doc<'a>
pub fn new(tree: &'a dyn Tree, index: &'a Index) -> Doc<'a>
index must be of tree as it is now.
Sourcepub fn html(tree: &'a Document, index: &'a Index) -> Doc<'a>
pub fn html(tree: &'a Document, index: &'a Index) -> Doc<'a>
An HTML page. index must be of tree as it is now.
pub fn tree(&self) -> &'a dyn Tree
pub fn is_xml(&self) -> bool
Sourcepub fn attr(&self, node: u32, name: &str) -> Option<&'a str>
pub fn attr(&self, node: u32, name: &str) -> Option<&'a str>
An attribute’s value by name: exact in XML, and in HTML compared ignoring ASCII case, as HTML names are lowercase.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Doc<'a>
impl<'a> !UnwindSafe for Doc<'a>
impl<'a> Forget for Doc<'a>
impl<'a> Freeze for Doc<'a>
impl<'a> Move for Doc<'a>
impl<'a> Send for Doc<'a>
impl<'a> Sync for Doc<'a>
impl<'a> Unpin for Doc<'a>
impl<'a> UnsafeUnpin for Doc<'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