pub trait ProvideMutex<Runtime>where
Runtime: Async,{
type Mutex<T: Async>: Async;
type MutexGuard<'a, T: Async>: 'a + Send + Sync + DerefMut<Target = T>;
// Required methods
fn new_mutex<T: Async>(item: T) -> Self::Mutex<T>;
fn acquire_mutex<'a, T: Async>(
mutex: &'a Self::Mutex<T>,
) -> impl Future<Output = Self::MutexGuard<'a, T>> + Send;
}Required Associated Types§
type Mutex<T: Async>: Async
type MutexGuard<'a, T: Async>: 'a + Send + Sync + DerefMut<Target = T>
Required Methods§
fn new_mutex<T: Async>(item: T) -> Self::Mutex<T>
fn acquire_mutex<'a, T: Async>( mutex: &'a Self::Mutex<T>, ) -> impl Future<Output = Self::MutexGuard<'a, T>> + Send
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.