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 ConsBranch::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 ConsNode<T>for accessing the contained value.Into<ConsBranch> for Rc<ConsNode<T>>for creating a newConsBranchfrom anRc.
Note that cloning a ConsNode directly is not cheap as it is with ConsBranch because
the node contains the value (of type T) itself.
Trait Implementations§
Source§impl<T: PartialEq> PartialEq for ConsNode<T>
impl<T: PartialEq> PartialEq for ConsNode<T>
impl<T: Eq> Eq for ConsNode<T>
impl<T> StructuralPartialEq for ConsNode<T>
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> UnsafeUnpin for ConsNode<T>where
T: UnsafeUnpin,
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