pub struct GenTree<T> { /* private fields */ }Implementations§
Source§impl<T> GenTree<T>
impl<T> GenTree<T>
pub fn new() -> Self
pub fn root(&self) -> &Position
pub fn size(&self) -> usize
pub fn num_children(&self, pos: &Position) -> usize
pub fn is_some(&self, pos: &Position) -> bool
pub fn is_empty(&self) -> bool
pub fn mut_root(&self, data: T)
Sourcepub fn depth(&self, pos: &Position) -> usize
pub fn depth(&self, pos: &Position) -> usize
The number of levels from a given node to the root
pub fn is_none(&self, position: &Position) -> bool
Sourcepub fn parent<'a>(&'a self, position: &Position) -> Option<Ref<'a, Position>>
pub fn parent<'a>(&'a self, position: &Position) -> Option<Ref<'a, Position>>
Yields a dynamic reference guard to the parent token inside the arena.
pub fn children(&self, position: &Position) -> Ref<'_, Vec<Position>>
pub fn get_data<'a>(&'a self, position: &Position) -> Option<Ref<'a, T>>
pub fn add_child(&self, parent_pos: &Position, data: T) -> Position
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for GenTree<T>
impl<T> !RefUnwindSafe for GenTree<T>
impl<T> Send for GenTree<T>where
T: Send,
impl<T> !Sync for GenTree<T>
impl<T> Unpin for GenTree<T>where
T: Unpin,
impl<T> UnwindSafe for GenTree<T>where
T: UnwindSafe,
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