pub struct LifetimeWeakState { /* private fields */ }Expand description
Weak handle to a LifetimeState, paired with the tag it was taken at.
LifetimeWeakState::upgrade fails once the owner is gone or the tag
changed, which is how LifetimeRef, LifetimeRefMut and
LifetimeLazy notice they went stale.
Implementations§
Source§impl LifetimeWeakState
impl LifetimeWeakState
Sourcepub unsafe fn upgrade_unchecked(&self) -> Option<LifetimeState>
pub unsafe fn upgrade_unchecked(&self) -> Option<LifetimeState>
Upgrades without checking the tag, so it succeeds even for a lifetime that was invalidated and reused.
§Safety
The counters are always valid to touch, but the value the lifetime used to guard may be a different one by now. Only use this to release counters that this handle itself acquired.
Sourcepub fn upgrade(&self) -> Option<LifetimeState>
pub fn upgrade(&self) -> Option<LifetimeState>
Upgrades to a strong handle, or returns None when the owner is gone
or was invalidated.
Sourcepub fn is_owned_by(&self, state: &LifetimeState) -> bool
pub fn is_owned_by(&self, state: &LifetimeState) -> bool
Returns true when this handle points at state.
Trait Implementations§
Source§impl Clone for LifetimeWeakState
impl Clone for LifetimeWeakState
Source§fn clone(&self) -> LifetimeWeakState
fn clone(&self) -> LifetimeWeakState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LifetimeWeakState
impl RefUnwindSafe for LifetimeWeakState
impl Send for LifetimeWeakState
impl Sync for LifetimeWeakState
impl Unpin for LifetimeWeakState
impl UnsafeUnpin for LifetimeWeakState
impl UnwindSafe for LifetimeWeakState
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