Struct concurrency_traits::CustomRwLock[][src]

pub struct CustomRwLock<T, R> { /* fields omitted */ }

A custom rw lock that can be built from any RawTryRwLock variant

Implementations

impl<T, R> CustomRwLock<T, R>[src]

pub fn from_raw(raw_lock: R, data: T) -> Self[src]

Creates a lock from a RawTryRwLock variant

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

Creates a lock using thr RawTryRwLock variant’s default implementation

Trait Implementations

impl<'a, T, R> AsyncRwLock<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawAsyncRwLock + 'a, 
[src]

type AsyncReadGuard = CustomReadGuard<'a, T, R>

The read guard for async reading

type AsyncWriteGuard = CustomWriteGuard<'a, T, R>

The write guard for async writing

type ReadFuture = Pin<Box<dyn Future<Output = Self::AsyncReadGuard> + 'a>>

The future returned by read_async

type WriteFuture = Pin<Box<dyn Future<Output = Self::AsyncWriteGuard> + 'a>>

The future returned by write_async

impl<'a, T, R> AsyncRwLockSized<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawAsyncRwLock + 'a, 
[src]

impl<'a, T, R> AsyncTimeoutRwLock<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawAsyncTimeoutRwLock + 'a, 
[src]

type ReadTimeoutFuture = Pin<Box<dyn Future<Output = Option<Self::AsyncReadGuard>> + 'a>>

type WriteTimeoutFuture = Pin<Box<dyn Future<Output = Option<Self::AsyncWriteGuard>> + 'a>>

impl<'a, T, R> AsyncTimeoutRwLockSized<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawAsyncTimeoutRwLock + 'a, 
[src]

impl<T: Debug, R: Debug> Debug for CustomRwLock<T, R>[src]

impl<'a, T, R> RwLock<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawRwLock + 'a, 
[src]

impl<'a, T, R> RwLockSized<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawRwLock + 'a, 
[src]

impl<'a, T, R> TimeoutRwLock<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawTimeoutRwLock + 'a, 
[src]

impl<'a, T, R> TimeoutRwLockSized<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawTimeoutRwLock + 'a, 
[src]

impl<'a, T, R> TryRwLock<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawTryRwLock + 'a, 
[src]

type Item = T

The item stored by this lock

type ReadGuard = CustomReadGuard<'a, T, R>

The guard for reading from this lock

type WriteGuard = CustomWriteGuard<'a, T, R>

The guard for writing to this lock

impl<'a, T, R> TryRwLockSized<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawTryRwLock + 'a, 
[src]

Auto Trait Implementations

impl<T, R> !RefUnwindSafe for CustomRwLock<T, R>

impl<T, R> Send for CustomRwLock<T, R> where
    R: Send,
    T: Send

impl<T, R> !Sync for CustomRwLock<T, R>

impl<T, R> Unpin for CustomRwLock<T, R> where
    R: Unpin,
    T: Unpin

impl<T, R> UnwindSafe for CustomRwLock<T, R> where
    R: 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<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.