dioxus_native_core::real_dom

Trait NodeImmutable

Source
pub trait NodeImmutable<V: FromAnyValue + Send + Sync = ()>: Sized {
Show 13 methods // Required methods fn real_dom(&self) -> &RealDom<V>; fn id(&self) -> NodeId; // Provided methods fn node_type(&self) -> ViewEntry<'_, NodeType<V>> { ... } fn get<'a, T: Component + Sync + Send>(&'a self) -> Option<ViewEntry<'a, T>> { ... } fn children_ids_advanced( &self, id: NodeId, enter_shadow_dom: bool, ) -> Vec<NodeId> { ... } fn child_ids(&self) -> Vec<NodeId> { ... } fn children(&self) -> Vec<NodeRef<'_, V>> { ... } fn parent_id_advanced( &self, id: NodeId, enter_shadow_dom: bool, ) -> Option<NodeId> { ... } fn parent_id(&self) -> Option<NodeId> { ... } fn parent(&self) -> Option<NodeRef<'_, V>> { ... } fn next(&self) -> Option<NodeRef<'_, V>> { ... } fn prev(&self) -> Option<NodeRef<'_, V>> { ... } fn height(&self) -> u16 { ... }
}
Expand description

A immutable view of a node

Required Methods§

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

Provided Methods§

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)

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.

Implementors§

Source§

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

Source§

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