Struct concurrency_traits::CustomMutex[][src]

pub struct CustomMutex<T, M: ?Sized> { /* fields omitted */ }

A Mutex based on a given RawTryMutex

Implementations

impl<T, M> CustomMutex<T, M>[src]

pub const fn from_raw(raw_mutex: M, data: T) -> Self[src]

Creates a new CustomMutex with a RawMutex

pub fn new(data: T) -> Self where
    M: Default
[src]

Creates a new mutex with a default raw

Trait Implementations

impl<'a, T, M> AsyncMutex<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawAsyncMutex + 'a, 
[src]

type AsyncGuard = CustomMutexGuard<'a, T, M>

The guard for this async mutex

type LockFuture = Pin<Box<dyn Future<Output = Self::AsyncGuard> + 'a>>

The future that the AsyncMutex::lock_async function returns

impl<'a, T, M> AsyncMutexSized<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawAsyncMutex + 'a, 
[src]

impl<'a, T, M> AsyncTimeoutMutex<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawAsyncTimeoutMutex + 'a, 
[src]

type LockTimeoutFuture = Pin<Box<dyn Future<Output = Option<Self::AsyncGuard>> + 'a>>

The future returned by lock_timeout_async

impl<'a, T, M> AsyncTimeoutMutexSized<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawAsyncTimeoutMutex + 'a, 
[src]

impl<T: Debug, M: Debug + ?Sized> Debug for CustomMutex<T, M>[src]

impl<T, M> Default for CustomMutex<T, M> where
    T: Default,
    M: Default
[src]

impl<T, M> From<T> for CustomMutex<T, M> where
    M: Default
[src]

impl<'a, T, M> Mutex<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawMutex + 'a, 
[src]

impl<'a, T, M> MutexSized<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawMutex + 'a, 
[src]

impl<T, M> Sync for CustomMutex<T, M> where
    T: Send,
    M: Sync
[src]

impl<'a, T, M> TimeoutMutex<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawTimeoutMutex + 'a, 
[src]

impl<'a, T, M> TimeoutMutexSized<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawTimeoutMutex + 'a, 
[src]

impl<'a, T, M> TryMutex<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawTryMutex + 'a, 
[src]

type Item = T

The item stored in the mutex

type Guard = CustomMutexGuard<'a, T, M>

The guard for the mutex

impl<'a, T, M> TryMutexSized<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawTryMutex + 'a, 
[src]

Auto Trait Implementations

impl<T, M> !RefUnwindSafe for CustomMutex<T, M>

impl<T, M: ?Sized> Send for CustomMutex<T, M> where
    M: Send,
    T: Send

impl<T, M: ?Sized> Unpin for CustomMutex<T, M> where
    M: Unpin,
    T: Unpin

impl<T, M: ?Sized> UnwindSafe for CustomMutex<T, M> where
    M: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.