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.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ForestNodeRc<T>
impl<T> !RefUnwindSafe for ForestNodeRc<T>
impl<T> !Send for ForestNodeRc<T>
impl<T> !Sync for ForestNodeRc<T>
impl<T> Unpin for ForestNodeRc<T>
impl<T> !UnwindSafe for ForestNodeRc<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