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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.