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

Can be used in place of a Mutex where reading T’s len() without needing to lock, is advantageous. When the Guard is released, T’s len() will be cached. The cached len() may be at most 1 lock behind current state.

Implementations

Constructs a new LenCachingMutex

Load the cached value that was returned from your T’s len() subsequent to the most recent lock being released.

Delegates to parking_lot::Mutex lock().

Delegates to parking_lot::Mutex try_lock().

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

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.