Struct rquery::Element
[−]
[src]
pub struct Element { /* fields omitted */ }
Represents a single element in the DOM tree.
Methods
impl Element
[src]
fn select_all<'a>(
&'a self,
selector: &str
) -> Result<Box<Iterator<Item = &'a Element> + 'a>, SelectError>
&'a self,
selector: &str
) -> Result<Box<Iterator<Item = &'a Element> + 'a>, SelectError>
Searches the elements children for elements matching the given CSS selector.
fn select<'a>(&'a self, selector: &str) -> Result<&'a Element, SelectError>
Just like select_all
but only returns the first match.
fn children_iter<'a>(&'a self) -> Box<Iterator<Item = &'a Element> + 'a>
Returns an iterator over the element’s direct children.
fn children_deep_iter<'a>(&'a self) -> Box<Iterator<Item = &'a Element> + 'a>
Returns an iterator over all the element’s children, including indirect child elements.
fn subtree_size(&self) -> usize
Returns the size of the DOM subtree, including the current element.
fn tag_name(&self) -> &str
Returns the name of the element’s tag.
fn attr(&self, attr_name: &str) -> Option<&String>
Returns the value of the element attribute if found.
fn text(&self) -> &String
Returns the text contained within the element.
fn matches(&self, compound_selector: &CompoundSelector) -> bool
Returns true if the element matches the given selector.
Trait Implementations
impl Clone for Element
[src]
fn clone(&self) -> Element
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more