pub struct Nw<T: ?Sized> { /* private fields */ }
Expand description
Weak reference to node.
Implementations§
source§impl<T> Nw<T>
impl<T> Nw<T>
sourcepub fn new() -> Self
pub fn new() -> Self
Create new empty instance.
Calling upgrade
and upgrade_ref
on the return value always gives None
.
source§impl<T: ?Sized> Nw<T>
impl<T: ?Sized> Nw<T>
sourcepub fn upgrade(&self) -> Option<Nr<T>>
pub fn upgrade(&self) -> Option<Nr<T>>
Create strong pointer to this node.
Returns None
if the inner value has since been dropped.
sourcepub fn upgrade_ref(&self) -> Option<&Nr<T>>
pub fn upgrade_ref(&self) -> Option<&Nr<T>>
Get the reference of strong pointer to this node.
Returns None
if the inner value has since been dropped.
sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Get the number of strong pointer to this node.
sourcepub fn weak_count(&self) -> usize
pub fn weak_count(&self) -> usize
Get the number of weak pointer to this node.
Trait Implementations§
source§impl<T: ?Sized> Ord for Nw<T>
impl<T: ?Sized> Ord for Nw<T>
source§impl<T: ?Sized> PartialEq for Nw<T>
impl<T: ?Sized> PartialEq for Nw<T>
source§impl<T: ?Sized> PartialOrd for Nw<T>
impl<T: ?Sized> PartialOrd for Nw<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: ?Sized> Eq for Nw<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Nw<T>
impl<T> !Send for Nw<T>
impl<T> !Sync for Nw<T>
impl<T: ?Sized> Unpin for Nw<T>
impl<T> !UnwindSafe for Nw<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