simplecss

Trait Element

source
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§

source

fn parent_element(&self) -> Option<Self>

Returns a parent element.

source

fn prev_sibling_element(&self) -> Option<Self>

Returns a previous sibling element.

source

fn has_local_name(&self, name: &str) -> bool

Checks that the element has a specified local name.

source

fn attribute_matches( &self, local_name: &str, operator: AttributeOperator<'_>, ) -> bool

Checks that the element has a specified attribute.

source

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.

Implementors§