pub struct PinTree<T> { /* private fields */ }Expand description
HashMap/Set<Pin<Arc<T>>> based fully safety tree collection
Implementations§
Source§impl<T> PinTree<T>
impl<T> PinTree<T>
Sourcepub fn set_parent(&mut self, this: &PinNode<T>, parent: &PinNode<T>) -> bool
pub fn set_parent(&mut self, this: &PinNode<T>, parent: &PinNode<T>) -> bool
Set parent-child relationship
If nodes are not in PinTree, they will be added
Sourcepub fn unset_parent(&mut self, this: &PinNode<T>, parent: &PinNode<T>) -> bool
pub fn unset_parent(&mut self, this: &PinNode<T>, parent: &PinNode<T>) -> bool
Unset parent-child relationship
Sourcepub fn get_parent(&self, this: &PinNode<T>) -> Option<&PinNode<T>>
pub fn get_parent(&self, this: &PinNode<T>) -> Option<&PinNode<T>>
Get the parent of node
Sourcepub fn get_childs(&self, this: &PinNode<T>) -> Iter<'_, PinNode<T>>
pub fn get_childs(&self, this: &PinNode<T>) -> Iter<'_, PinNode<T>>
Get the childs of node
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for PinTree<T>
impl<T> RefUnwindSafe for PinTree<T>where
T: RefUnwindSafe,
impl<T> Send for PinTree<T>
impl<T> Sync for PinTree<T>
impl<T> Unpin for PinTree<T>
impl<T> UnwindSafe for PinTree<T>where
T: RefUnwindSafe,
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