Struct cl_structures::tree::Tree
source · pub struct Tree<T> { /* private fields */ }
Expand description
An insert-only unordered tree, backed by a Vec
Implementations§
source§impl<T> Tree<T>
impl<T> Tree<T>
Tree operations
pub fn new() -> Self
sourcepub fn root(&mut self, value: T) -> Result<Ref<T>, T>
pub fn root(&mut self, value: T) -> Result<Ref<T>, T>
Creates a new root for the tree.
If the tree already has a root, the value will be returned.
pub fn get_root(&mut self) -> Option<Ref<T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Tree<T>
impl<T> RefUnwindSafe for Tree<T>where
T: RefUnwindSafe,
impl<T> Send for Tree<T>where
T: Send,
impl<T> Sync for Tree<T>where
T: Sync,
impl<T> Unpin for Tree<T>where
T: Unpin,
impl<T> UnwindSafe for Tree<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