pub struct CursorMut<'a, T> { /* private fields */ }Expand description
CursorMut takes ’a to tie it to the tree’s lifetime which prevents dangling pointers by gating scopes
See module-level documentation for more details.
Implementations§
Source§impl<'a, T> CursorMut<'a, T>
impl<'a, T> CursorMut<'a, T>
pub fn get_data(&self) -> Option<&T>
pub fn is_none(&self) -> bool
pub fn is_some(&self) -> bool
pub fn num_children(&self) -> usize
pub fn children_iter(&self) -> ChildIter<'a, T> ⓘ
Sourcepub fn ascend(&mut self) -> Result<(), &str>
pub fn ascend(&mut self) -> Result<(), &str>
Uses Cell for interior mutability in order to retain signature semantics such that navigation methods retain &self borrows.
Sourcepub fn descend<F>(&mut self, predicate: F) -> Result<(), &str>
pub fn descend<F>(&mut self, predicate: F) -> Result<(), &str>
Uses a closure to descend to the correct child node. Ex:
Sourcepub fn add_child(&mut self, data: T)
pub fn add_child(&mut self, data: T)
Creates and adds a child Node to the position of the cursor,
then moves the cursor to the new child Node.
pub fn delete(&mut self) -> Option<T>
Auto Trait Implementations§
impl<'a, T> !Freeze for CursorMut<'a, T>
impl<'a, T> !RefUnwindSafe for CursorMut<'a, T>
impl<'a, T> !Send for CursorMut<'a, T>
impl<'a, T> !Sync for CursorMut<'a, T>
impl<'a, T> Unpin for CursorMut<'a, T>
impl<'a, T> !UnwindSafe for CursorMut<'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