pub struct UnsyncTokenLock<T: ?Sized, Keyhole> { /* private fields */ }
Expand description

Like TokenLock, but the usable Tokens are constrained by Unsync. This subtle difference allows it to be Sync even if T is not.

See the module-level documentation for more details.

Implementations

Construct a Self.

Construct a Self with a default-constructed Keyhole.

Consume self, returning the contained data.

Get a reference to the contained Keyhole (keyhole).

Get a raw pointer to the contained data.

Get a reference to the contained data. Panic if token doesn’t fit in the keyhole.

Get a mutable reference to the contained data. Panic if token doesn’t fit in the keyhole.

Get a reference to the contained data. Return BadTokenError if token doesn’t fit in the keyhole.

Get a mutable reference to the contained data. Return BadTokenError if token doesn’t fit in the keyhole.

Get a mutable reference to the contained data.

Get the contained data by cloning. Panic if token doesn’t fit in the keyhole.

Get the contained data by cloning. Return BadTokenError if token doesn’t fit in the keyhole.

Assign a new value. Panic if token doesn’t fit in thekeyhole.

Assign a new value. Return BadTokenError if token doesn’t fit in the keyhole.

Take the contained data, leaving Default::default() in its place. Panic if token doesn’t fit in the keyhole.

Take the contained data, leaving Default::default() in its place. Return BadTokenError if token doesn’t fit in the keyhole.

Replace the contained data with a new one. Panic if token doesn’t fit in the keyhole.

This function corresponds to std::mem::replace.

Replace the contained data with a new one computed by the given closure. Panic if token doesn’t fit in the keyhole.

This function corresponds to std::mem::replace.

Replace the contained data with a new one computed by f. Panic if token doesn’t fit in the keyhole.

This function corresponds to std::mem::replace.

Swap the contained data with the contained data of other. Panic if token doesn’t fit in the keyhole of both TokenLocks.

This function corresponds to std::mem::swap.

Swap the contained data with the contained data of other. Return BadTokenError if token doesn’t fit in the keyhole of both TokenLocks.

Clone self. Panic if token doesn’t fit in the keyhole.

Clone self. Return BadTokenError if token doesn’t fit in the keyhole.

Trait Implementations

The constant default value.

Formats the value using the given formatter. Read more

Returns the “default value” for a 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.