[−][src]Struct arquery::Element
Represents a single element in the DOM tree.
Methods
impl Element
[src]
pub fn select_all<'a>(
&'a self,
selector: &str
) -> Result<Box<dyn Iterator<Item = &'a Element> + 'a>, SelectError>
[src]
&'a self,
selector: &str
) -> Result<Box<dyn Iterator<Item = &'a Element> + 'a>, SelectError>
Searches the elements children for elements matching the given CSS selector.
pub fn select<'a>(&'a self, selector: &str) -> Result<&'a Element, SelectError>
[src]
Just like select_all
but only returns the first match.
pub fn children_iter<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Element> + 'a>
[src]
Returns an iterator over the element’s direct children.
pub fn children_deep_iter<'a>(
&'a self
) -> Box<dyn Iterator<Item = &'a Element> + 'a>
[src]
&'a self
) -> Box<dyn Iterator<Item = &'a Element> + 'a>
Returns an iterator over all the element’s children, including indirect child elements.
pub fn subtree_size(&self) -> usize
[src]
Returns the size of the DOM subtree, including the current element.
pub fn tag_name(&self) -> &str
[src]
Returns the name of the element’s tag.
pub fn attr(&self, attr_name: &str) -> Option<&String>
[src]
Returns the value of the element attribute if found.
pub fn text(&self) -> &String
[src]
Returns the text contained within the element.
pub fn matches(&self, compound_selector: &CompoundSelector) -> bool
[src]
Returns true if the element matches the given selector.
pub fn node_index(&self) -> usize
[src]
Returns the node index for the element.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,