Skip to main content

Element

Trait Element 

Source
pub trait Element: Sized + Clone {
Show 43 methods // Required methods fn local_name(&self) -> &str; fn id(&self) -> Option<&str>; fn has_class(&self, name: &str) -> bool; fn has_attribute(&self, name: &str) -> bool; fn attribute_value(&self, name: &str) -> Option<&str>; fn parent_element(&self) -> Option<Self>; fn prev_sibling_element(&self) -> Option<Self>; fn next_sibling_element(&self) -> Option<Self>; fn first_child_element(&self) -> Option<Self>; fn last_child_element(&self) -> Option<Self>; // Provided methods fn namespace(&self) -> Option<&str> { ... } fn is_root(&self) -> bool { ... } fn is_empty(&self) -> bool { ... } fn is_link(&self) -> bool { ... } fn is_visited(&self) -> bool { ... } fn is_hover(&self) -> bool { ... } fn is_active(&self) -> bool { ... } fn is_focus(&self) -> bool { ... } fn is_focus_within(&self) -> bool { ... } fn is_focus_visible(&self) -> bool { ... } fn is_enabled(&self) -> bool { ... } fn is_disabled(&self) -> bool { ... } fn is_checked(&self) -> bool { ... } fn is_target(&self) -> bool { ... } fn is_read_write(&self) -> bool { ... } fn is_read_only(&self) -> bool { ... } fn is_required(&self) -> bool { ... } fn is_optional(&self) -> bool { ... } fn is_valid(&self) -> bool { ... } fn is_invalid(&self) -> bool { ... } fn is_default(&self) -> bool { ... } fn is_indeterminate(&self) -> bool { ... } fn is_placeholder_shown(&self) -> bool { ... } fn is_any_link(&self) -> bool { ... } fn is_in_range(&self) -> bool { ... } fn is_out_of_range(&self) -> bool { ... } fn lang(&self) -> Option<&str> { ... } fn child_elements(&self) -> Vec<Self> { ... } fn sibling_index(&self) -> i32 { ... } fn sibling_index_from_end(&self) -> i32 { ... } fn sibling_type_index(&self) -> i32 { ... } fn sibling_type_index_from_end(&self) -> i32 { ... } fn sibling_type_count(&self) -> i32 { ... }
}
Expand description

Trait for DOM elements that can be matched against CSS selectors.

Required Methods§

Source

fn local_name(&self) -> &str

Source

fn id(&self) -> Option<&str>

Source

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

Source

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

Source

fn attribute_value(&self, name: &str) -> Option<&str>

Source

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

Source

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

Source

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

Source

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

Source

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

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a> Element for DomElement<'a>