pub struct NodeRef<'a, V: FromAnyValue + Send + Sync = ()> { /* private fields */ }
Expand description

An immutable reference to a node in a RealDom

Trait Implementations§

source§

impl<'a, V: FromAnyValue + Send + Sync> Clone for NodeRef<'a, V>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a, V: FromAnyValue + Send + Sync> NodeImmutable<V> for NodeRef<'a, V>

source§

fn real_dom(&self) -> &RealDom<V>

Get the real dom this node was created in
source§

fn id(&self) -> NodeId

Get the id of the current node
source§

fn node_type(&self) -> ViewEntry<'_, NodeType<V>>

Get the type of the current node
source§

fn get<'a, T: Component + Sync + Send>(&'a self) -> Option<ViewEntry<'a, T>>

Get a component from the current node
source§

fn children_ids_advanced( &self, id: NodeId, enter_shadow_dom: bool ) -> Vec<NodeId>

Get the ids of the children of the current node, if enter_shadow_dom is true and the current node is a shadow slot, the ids of the nodes under the node the shadow slot is attached to will be returned
source§

fn child_ids(&self) -> Vec<NodeId>

Get the ids of the children of the current node
source§

fn children(&self) -> Vec<NodeRef<'_, V>>

Get the children of the current node
source§

fn parent_id_advanced( &self, id: NodeId, enter_shadow_dom: bool ) -> Option<NodeId>

Get the id of the parent of the current node, if enter_shadow_dom is true and the current node is a shadow root, the node the shadow root is attached to will be returned
source§

fn parent_id(&self) -> Option<NodeId>

Get the id of the parent of the current node
source§

fn parent(&self) -> Option<NodeRef<'_, V>>

Get the parent of the current node
source§

fn next(&self) -> Option<NodeRef<'_, V>>

Get the node after the current node
source§

fn prev(&self) -> Option<NodeRef<'_, V>>

Get the node before the current node
source§

fn height(&self) -> u16

Get the height of the current node in the tree (the number of nodes between the current node and the root)
source§

impl<'a, V: FromAnyValue + Send + Sync> Copy for NodeRef<'a, V>

Auto Trait Implementations§

§

impl<'a, V = ()> !RefUnwindSafe for NodeRef<'a, V>

§

impl<'a, V> Send for NodeRef<'a, V>

§

impl<'a, V> Sync for NodeRef<'a, V>

§

impl<'a, V> Unpin for NodeRef<'a, V>

§

impl<'a, V = ()> !UnwindSafe for NodeRef<'a, V>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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<T> CloneAny for Twhere T: Any + Clone,