Skip to main content

DomElement

Struct DomElement 

Source
pub struct DomElement<'a> {
    pub dom: &'a Dom,
    pub id: NodeId,
}
Expand description

A DOM element wrapper that implements crate::css_selectors::Element.

This is a lightweight handle: it borrows the Dom and holds a NodeId. Created on-the-fly for selector matching.

Fields§

§dom: &'a Dom§id: NodeId

Implementations§

Source§

impl<'a> DomElement<'a>

Source

pub fn new(dom: &'a Dom, id: NodeId) -> Option<Self>

Source

pub fn node_id(&self) -> NodeId

Trait Implementations§

Source§

impl<'a> Clone for DomElement<'a>

Source§

fn clone(&self) -> DomElement<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for DomElement<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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

Source§

fn local_name(&self) -> &str

Source§

fn namespace(&self) -> Option<&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>

Source§

fn is_root(&self) -> bool

Source§

fn is_empty(&self) -> bool

Source§

fn is_visited(&self) -> bool

Source§

fn is_hover(&self) -> bool

Source§

fn is_active(&self) -> bool

Source§

fn is_focus(&self) -> bool

Source§

fn is_focus_within(&self) -> bool

Source§

fn is_focus_visible(&self) -> bool

Source§

fn is_enabled(&self) -> bool

Source§

fn is_disabled(&self) -> bool

Source§

fn is_checked(&self) -> bool

Source§

fn is_target(&self) -> bool

Source§

fn is_read_write(&self) -> bool

Source§

fn is_read_only(&self) -> bool

Source§

fn is_required(&self) -> bool

Source§

fn is_optional(&self) -> bool

Source§

fn is_valid(&self) -> bool

Source§

fn is_invalid(&self) -> bool

Source§

fn is_default(&self) -> bool

Source§

fn is_indeterminate(&self) -> bool

Source§

fn is_placeholder_shown(&self) -> bool

Source§

fn is_in_range(&self) -> bool

Source§

fn is_out_of_range(&self) -> bool

Source§

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

Source§

fn child_elements(&self) -> Vec<Self>

Source§

fn sibling_index(&self) -> i32

Source§

fn sibling_index_from_end(&self) -> i32

Source§

fn sibling_type_index(&self) -> i32

Source§

fn sibling_type_index_from_end(&self) -> i32

Source§

fn sibling_type_count(&self) -> i32

Auto Trait Implementations§

§

impl<'a> Freeze for DomElement<'a>

§

impl<'a> RefUnwindSafe for DomElement<'a>

§

impl<'a> Send for DomElement<'a>

§

impl<'a> Sync for DomElement<'a>

§

impl<'a> Unpin for DomElement<'a>

§

impl<'a> UnsafeUnpin for DomElement<'a>

§

impl<'a> UnwindSafe for DomElement<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more