pub trait Element: Sized {
// Required methods
fn parent_element(&self) -> Option<Self>;
fn prev_sibling_element(&self) -> Option<Self>;
fn has_local_name(&self, name: &str) -> bool;
fn attribute_matches(
&self,
local_name: &str,
operator: AttributeOperator<'_>,
) -> bool;
fn pseudo_class_matches(&self, class: PseudoClass<'_>) -> bool;
}
Expand description
A trait to query an element node metadata.
Required Methods§
sourcefn parent_element(&self) -> Option<Self>
fn parent_element(&self) -> Option<Self>
Returns a parent element.
sourcefn prev_sibling_element(&self) -> Option<Self>
fn prev_sibling_element(&self) -> Option<Self>
Returns a previous sibling element.
sourcefn has_local_name(&self, name: &str) -> bool
fn has_local_name(&self, name: &str) -> bool
Checks that the element has a specified local name.
sourcefn attribute_matches(
&self,
local_name: &str,
operator: AttributeOperator<'_>,
) -> bool
fn attribute_matches( &self, local_name: &str, operator: AttributeOperator<'_>, ) -> bool
Checks that the element has a specified attribute.
sourcefn pseudo_class_matches(&self, class: PseudoClass<'_>) -> bool
fn pseudo_class_matches(&self, class: PseudoClass<'_>) -> bool
Checks that the element matches a specified pseudo-class.
Object Safety§
This trait is not object safe.