pub struct NodeMut<'a, T: 'a> { /* private fields */ }
Expand description
Node mutator.
Implementations§
source§impl<'a, T: 'a> NodeMut<'a, T>
impl<'a, T: 'a> NodeMut<'a, T>
sourcepub fn prev_sibling(&mut self) -> Option<NodeMut<'_, T>>
pub fn prev_sibling(&mut self) -> Option<NodeMut<'_, T>>
Returns the previous sibling of this node.
sourcepub fn next_sibling(&mut self) -> Option<NodeMut<'_, T>>
pub fn next_sibling(&mut self) -> Option<NodeMut<'_, T>>
Returns the next sibling of this node.
sourcepub fn first_child(&mut self) -> Option<NodeMut<'_, T>>
pub fn first_child(&mut self) -> Option<NodeMut<'_, T>>
Returns the first child of this node.
sourcepub fn last_child(&mut self) -> Option<NodeMut<'_, T>>
pub fn last_child(&mut self) -> Option<NodeMut<'_, T>>
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 insert_before(&mut self, value: T) -> NodeMut<'_, T>
pub fn insert_before(&mut self, value: T) -> NodeMut<'_, T>
sourcepub fn insert_after(&mut self, value: T) -> NodeMut<'_, T>
pub fn insert_after(&mut self, value: T) -> NodeMut<'_, T>
sourcepub fn prepend_id(&mut self, new_child_id: NodeId) -> NodeMut<'_, T>
pub fn prepend_id(&mut self, new_child_id: NodeId) -> NodeMut<'_, T>
sourcepub fn insert_id_before(&mut self, new_sibling_id: NodeId) -> NodeMut<'_, T>
pub fn insert_id_before(&mut self, new_sibling_id: NodeId) -> NodeMut<'_, T>
Inserts a sibling before this node.
§Panics
- Panics if
new_sibling_id
is not valid. - Panics if this node is an orphan.
sourcepub fn insert_id_after(&mut self, new_sibling_id: NodeId) -> NodeMut<'_, T>
pub fn insert_id_after(&mut self, new_sibling_id: NodeId) -> NodeMut<'_, T>
Inserts a sibling after this node.
§Panics
- Panics if
new_sibling_id
is not valid. - Panics if this node is an orphan.
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.
§Panics
Panics if from_id
is not valid.
sourcepub fn reparent_from_id_prepend(&mut self, from_id: NodeId)
pub fn reparent_from_id_prepend(&mut self, from_id: NodeId)
Reparents the children of a node, prepending them to this node.
§Panics
Panics if from_id
is not valid.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for NodeMut<'a, T>
impl<'a, T> RefUnwindSafe for NodeMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for NodeMut<'a, T>where
T: Send,
impl<'a, T> Sync for NodeMut<'a, T>where
T: Sync,
impl<'a, T> Unpin for NodeMut<'a, T>
impl<'a, T> !UnwindSafe for NodeMut<'a, T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more