pub struct Document { /* private fields */ }
Expand description
The DOM tree representation of the parsed document.
Implementations§
Source§impl Document
impl Document
Sourcepub fn new_from_xml_stream<R: Read>(
stream: R,
) -> Result<Document, DocumentError>
pub fn new_from_xml_stream<R: Read>( stream: R, ) -> Result<Document, DocumentError>
Creates a new document from a byte stream.
Sourcepub fn new_from_xml_string(string: &str) -> Result<Document, DocumentError>
pub fn new_from_xml_string(string: &str) -> Result<Document, DocumentError>
Creates a new document from a string.
Sourcepub fn new_from_xml_file(filename: &str) -> Result<Document, DocumentError>
pub fn new_from_xml_file(filename: &str) -> Result<Document, DocumentError>
Creates a new document from a file.
Sourcepub fn number_of_elements(&self) -> usize
pub fn number_of_elements(&self) -> usize
Returns the total number of elements in the document.
Sourcepub fn select_all<'a>(
&'a self,
selector: &str,
) -> Result<Box<dyn Iterator<Item = &'a Element> + 'a>, SelectError>
pub fn select_all<'a>( &'a self, selector: &str, ) -> Result<Box<dyn Iterator<Item = &'a Element> + 'a>, SelectError>
Searches the document for elements matching the given CSS selector.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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