pub trait NodeImmutable<V: FromAnyValue + Send + Sync = ()>: Sized {
    // 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(&self) -> Option<NodeId> { ... }
    fn parent(&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(&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 height(&self) -> u16

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

Object Safety§

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>