pub trait AsyncMutex<DS: Sized> {
type MutxGuard<'mux>: AsyncMutexGuard<'mux, DS>
where Self: 'mux;
// Required methods
fn a_new(v: DS) -> Self;
async fn a_lock<'mux>(&'mux self) -> Self::MutxGuard<'mux>;
}
Expand description
A trait which generalize the mutex from the std lib’s of multiple async executors.
The trait can be implemented on mutex
directly or on a structure with mutex as
inner type.
Required Associated Types§
Sourcetype MutxGuard<'mux>: AsyncMutexGuard<'mux, DS>
where
Self: 'mux
type MutxGuard<'mux>: AsyncMutexGuard<'mux, DS> where Self: 'mux
A mutex guard type.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.