pub struct ConsNode<T> { /* private fields */ }Available on crate features
collections and cons only.Expand description
Largely intended as an internal type, these nodes are returned by [ConsTree::into_iter_rc]
because the interior of the Rc can’t be unwrapped in place.
To help using these nodes, a couple of useful traits have been implemented:
Deref<Target = T> for ConsTreeNode<T>for accessing the contained value.Into<ConsTree> for Rc<ConsTreeNode<T>>for creating a new [ConsTree] from anRc.
Note that cloning a ConsTreeNode directly is not cheap as it is with [ConsTree] because
the node contains the value (of type T) itself.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ConsNode<T>where
T: Freeze,
impl<T> RefUnwindSafe for ConsNode<T>where
T: RefUnwindSafe,
impl<T> !Send for ConsNode<T>
impl<T> !Sync for ConsNode<T>
impl<T> Unpin for ConsNode<T>where
T: Unpin,
impl<T> UnwindSafe for ConsNode<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