pub struct NodeRef<T> { /* private fields */ }
Expand description
Node reference.
Implementations§
Source§impl<T> NodeRef<T>
impl<T> NodeRef<T>
Sourcepub fn prev_siblings(&self) -> PrevSiblings<T> ⓘ
pub fn prev_siblings(&self) -> PrevSiblings<T> ⓘ
Returns an iterator over previous siblings.
Sourcepub fn next_siblings(&self) -> NextSiblings<T> ⓘ
pub fn next_siblings(&self) -> NextSiblings<T> ⓘ
Returns an iterator over next siblings.
Sourcepub fn first_children(&self) -> FirstChildren<T> ⓘ
pub fn first_children(&self) -> FirstChildren<T> ⓘ
Returns an iterator over first children.
Sourcepub fn last_children(&self) -> LastChildren<T> ⓘ
pub fn last_children(&self) -> LastChildren<T> ⓘ
Returns an iterator over last children.
Sourcepub fn traverse(&self) -> Traverse<T> ⓘ
pub fn traverse(&self) -> Traverse<T> ⓘ
Returns an iterator which traverses the subtree starting at this node.
Sourcepub fn descendants(&self) -> Descendants<T> ⓘ
pub fn descendants(&self) -> Descendants<T> ⓘ
Returns an iterator over this node and its descendants.
Source§impl<T> NodeRef<T>
impl<T> NodeRef<T>
Sourcepub fn map_value<F, R>(&self, map_fn: F) -> Option<R>
pub fn map_value<F, R>(&self, map_fn: F) -> Option<R>
Returns the result of map_fn applied to the value of this node.
Sourcepub fn update_value<F>(&self, update_fn: F) -> bool
pub fn update_value<F>(&self, update_fn: F) -> bool
Update the value of this node.
Sourcepub fn prev_sibling(&self) -> Option<Self>
pub fn prev_sibling(&self) -> Option<Self>
Returns the previous sibling of this node.
Sourcepub fn next_sibling(&self) -> Option<Self>
pub fn next_sibling(&self) -> Option<Self>
Returns the next sibling of this node.
Sourcepub fn first_child(&self) -> Option<Self>
pub fn first_child(&self) -> Option<Self>
Returns the first child of this node.
Sourcepub fn last_child(&self) -> Option<Self>
pub fn last_child(&self) -> Option<Self>
Returns the last child of this node.
Sourcepub fn has_siblings(&self) -> bool
pub fn has_siblings(&self) -> bool
Returns true if this node has siblings.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Returns true if this node has children.
Sourcepub fn append_id(&mut self, new_child_id: NodeId) -> Option<NodeRef<T>>
pub fn append_id(&mut self, new_child_id: NodeId) -> Option<NodeRef<T>>
Appends a child to this node.
Sourcepub fn insert_before(&mut self, value: T) -> Option<NodeRef<T>>
pub fn insert_before(&mut self, value: T) -> Option<NodeRef<T>>
Inserts a new sibling before this node.
Sourcepub fn insert_id_before(&mut self, new_sibling_id: NodeId) -> Option<NodeRef<T>>
pub fn insert_id_before(&mut self, new_sibling_id: NodeId) -> Option<NodeRef<T>>
Inserts a sibling before this node.
Sourcepub fn insert_after(&mut self, value: T) -> Option<NodeRef<T>>
pub fn insert_after(&mut self, value: T) -> Option<NodeRef<T>>
Inserts a new sibling after this node.
Sourcepub fn insert_id_after(&mut self, new_sibling_id: NodeId) -> Option<NodeRef<T>>
pub fn insert_id_after(&mut self, new_sibling_id: NodeId) -> Option<NodeRef<T>>
Inserts a sibling after this node.
Sourcepub fn reparent_from_id_append(&mut self, from_id: NodeId)
pub fn reparent_from_id_append(&mut self, from_id: NodeId)
Reparents the children of a node, appending them to this node.