Struct maomi_tree::ForestNodeRc
source · pub struct ForestNodeRc<T> { /* private fields */ }
Expand description
A node in a forest.
Implementations§
source§impl<T> ForestNodeRc<T>
impl<T> ForestNodeRc<T>
sourcepub fn new_forest(content: T) -> Self
pub fn new_forest(content: T) -> Self
Create a node in a new forest.
sourcepub fn try_borrow<'a>(&'a self) -> Option<ForestNode<'a, T>>
pub fn try_borrow<'a>(&'a self) -> Option<ForestNode<'a, T>>
Get an immutable reference of the node.
Returns None
if already borrowed.
sourcepub fn borrow<'a>(&'a self) -> ForestNode<'a, T>
pub fn borrow<'a>(&'a self) -> ForestNode<'a, T>
Get an immutable reference of the node.
sourcepub fn try_borrow_mut<'a>(&'a self) -> Option<ForestNodeMut<'a, T>>
pub fn try_borrow_mut<'a>(&'a self) -> Option<ForestNodeMut<'a, T>>
Get a mutable reference of the tree root.
Returns None
if already borrowed.
sourcepub fn borrow_mut<'a>(&'a self) -> ForestNodeMut<'a, T>
pub fn borrow_mut<'a>(&'a self) -> ForestNodeMut<'a, T>
Get a mutable reference of the tree root.
sourcepub fn token(&self) -> ForestToken
pub fn token(&self) -> ForestToken
Get a token.