Struct arc_swap::Lease

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

Implementations

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

Converts the value into a raw pointer. Read more
Converts the value into a raw pointer. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.