Struct arc_swap::Lease[][src]

pub struct Lease<T: RefCnt> { /* fields omitted */ }

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 Leases around and if too many are held, the following ones will just fall back to creating the Arc internally.

Methods

impl<T: RefCnt> Lease<T>
[src]

Loads a full Arc from the lease.

A consuming version of upgrade.

This is a bit faster in certain situations, but consumes the lease.

Returns access to the data held.

This returns Option even when it can't hold NULL internally, to keep the interface the same. But there's also the Deref trait for the non-NULL cases, which is usually more comfortable.

Checks if it contains a null pointer.

Note that for non-NULL T, this always returns false.

Trait Implementations

impl<'a, T: RefCnt> AsRaw<T::Base> for &'a Lease<T>
[src]

Converts the value into a raw pointer. Read more

impl<T: RefCnt> AsRaw<T::Base> for Lease<T>
[src]

Converts the value into a raw pointer. Read more

impl<T: NonNull> Deref for Lease<T>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<T> Debug for Lease<T> where
    T: RefCnt,
    T::Base: Debug
[src]

Formats the value using the given formatter. Read more

impl<T> Display for Lease<T> where
    T: NonNull,
    T::Base: Display
[src]

Formats the value using the given formatter. Read more

impl<T: RefCnt> Drop for Lease<T>
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<T> !Send for Lease<T>

impl<T> !Sync for Lease<T>