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>
[src]
&'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>
[src]
Just like select_all
but only returns the first match.
fn children_iter<'a>(&'a self) -> Box<Iterator<Item = &'a Element> + 'a>
[src]
Returns an iterator over the element’s direct children.
fn children_deep_iter<'a>(&'a self) -> Box<Iterator<Item = &'a Element> + 'a>
[src]
Returns an iterator over all the element’s children, including indirect child elements.
fn subtree_size(&self) -> usize
[src]
Returns the size of the DOM subtree, including the current element.
fn tag_name(&self) -> &str
[src]
Returns the name of the element’s tag.
fn attr(&self, attr_name: &str) -> Option<&String>
[src]
Returns the value of the element attribute if found.
fn text(&self) -> &String
[src]
Returns the text contained within the element.
fn matches(&self, compound_selector: &CompoundSelector) -> bool
[src]
Returns true if the element matches the given selector.
fn node_index(&self) -> usize
[src]
Returns the node index for the element.
Trait Implementations
impl Clone for Element
[src]
fn clone(&self) -> Element
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more