pub struct Lease<T: RefCnt> { /* private fields */ }
Expand description
A temporary storage of the pointer.
This, unlike Guard
, does not block any write operations and is usually
faster than loading the full Arc
. However, this holds only if each thread keeps only small
number of Lease
s around and if too many are held, the following ones will just fall back to
creating the Arc
internally.
Implementations
sourceimpl<T: RefCnt> Lease<T>
impl<T: RefCnt> Lease<T>
sourcepub fn into_upgrade(lease: Self) -> T
pub fn into_upgrade(lease: Self) -> T
A consuming version of upgrade
.
This is a bit faster in certain situations, but consumes the lease.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Lease<T>where
T: RefUnwindSafe,
<T as RefCnt>::Base: RefUnwindSafe,
impl<T> !Send for Lease<T>
impl<T> !Sync for Lease<T>
impl<T> Unpin for Lease<T>where
T: Unpin,
impl<T> UnwindSafe for Lease<T>where
T: UnwindSafe,
<T as RefCnt>::Base: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more