Struct rquery::Element [] [src]

pub struct Element {
    // some fields omitted
}

Represents a single element in the DOM tree.

Methods

impl Element
[src]

fn select_all<'a>(&'a self, selector: &'a str) -> Result<Box<Iterator<Item=&'a Element> + 'a>, ()>

Searches the elements children for elements matching the given CSS selector.

fn select<'a>(&'a self, selector: &'a str) -> Result<&'a Element()>

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.