pub struct Lease<T> { /* private fields */ }
Expand description

Holds a leased resource and implements Drop in order to return the resource.

This simple wrapper type implements only the AsRef, AsMut, Deref and DerefMut traits and provides no other functionality. A freshly leased resource is guaranteed to have no other owners and may be mutably accessed.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Binds the resource to a graph-like object. Read more
Binds the resource to a graph-like object. Read more
Binds the resource to a graph-like object. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
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.

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.