pub struct RawThreadMutex<R: RawMutex, G: GetThreadId> { /* private fields */ }
Expand description

A mutex type that knows when it would deadlock

Implementations§

Blocks for the mutex to be available, and returns true if the mutex isn’t already locked on the current thread.

Returns Some(true) if able to successfully lock without blocking, Some(false) otherwise, and None when the mutex is already locked on the current thread.

Unlocks this mutex. The inner mutex may not be unlocked if this mutex was acquired previously in the current thread.

Safety

This method may only be called if the mutex is held by the current thread.

Trait Implementations§

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.