pub struct GenericMutex<MutexType: RawMutex, T> { /* private fields */ }
Expand description

A futures-aware mutex.

Implementations

Creates a new futures-aware mutex.

is_fair defines whether the Mutex should behave be fair regarding the order of waiters. A fair Mutex will only allow the first waiter which tried to lock but failed to lock the Mutex once it’s available again. Other waiters must wait until either this locking attempt completes, and the Mutex gets unlocked again, or until the MutexLockFuture which tried to gain the lock is dropped.

Acquire the mutex asynchronously.

This method returns a future that will resolve once the mutex has been successfully acquired.

Tries to acquire the mutex

If acquiring the mutex is successful, a GenericMutexGuard will be returned, which allows to access the contained data.

Otherwise None will be returned.

Returns whether the mutex is locked.

Trait Implementations

Formats the value using the given formatter. 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.