Trait concurrency_traits::TryRwLock[][src]

pub trait TryRwLock<'a> {
    type Item: ?Sized;
    type ReadGuard: Deref<Target = Self::Item>;
    type WriteGuard: DerefMut<Target = Self::Item>;
    fn try_read(&'a self) -> Option<Self::ReadGuard>;
fn try_write(&'a self) -> Option<Self::WriteGuard>; }

A non-blocking rwlock with try functions

Implementation

It is recommended to implement TryRwLockSized if the implement-ee can be sized.

Associated Types

type Item: ?Sized[src]

The item stored by this lock

type ReadGuard: Deref<Target = Self::Item>[src]

The guard for reading from this lock

type WriteGuard: DerefMut<Target = Self::Item>[src]

The guard for writing to this lock

Loading content...

Required methods

fn try_read(&'a self) -> Option<Self::ReadGuard>[src]

Tries to read from the lock, returning None if cannot immediately

fn try_write(&'a self) -> Option<Self::WriteGuard>[src]

Tries to write to the lock, returning None if not able to immediately

Loading content...

Implementations on Foreign Types

impl<'a, T: ?Sized> TryRwLock<'a> for RwLock<T> where
    T: 'a, 
[src]

type Item = T

type ReadGuard = RwLockReadGuard<'a, T>

type WriteGuard = RwLockWriteGuard<'a, T>

impl<'__a, 'a, T: ?Sized> TryRwLock<'__a> for &'a T where
    T: TryRwLock<'__a>, 
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'__a, 'a, T: ?Sized> TryRwLock<'__a> for &'a mut T where
    T: TryRwLock<'__a>, 
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'__a, T: ?Sized> TryRwLock<'__a> for ManuallyDrop<T> where
    T: TryRwLock<'__a>, 
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'__a, T> TryRwLock<'__a> for AssertUnwindSafe<T> where
    T: TryRwLock<'__a>, 
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'__a, T: ?Sized> TryRwLock<'__a> for Rc<T> where
    T: TryRwLock<'__a>, 
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'__a, T: ?Sized> TryRwLock<'__a> for Arc<T> where
    T: TryRwLock<'__a>, 
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'__a, T: ?Sized> TryRwLock<'__a> for Box<T> where
    T: TryRwLock<'__a>, 
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'__a, 'a, T> TryRwLock<'__a> for Cow<'a, T> where
    T: TryRwLock<'__a> + Clone
[src]

type Item = T::Item

type ReadGuard = T::ReadGuard

type WriteGuard = T::WriteGuard

impl<'a, T> TryRwLock<'a> for Pin<T> where
    T: Deref,
    T::Target: TryRwLock<'a>, 
[src]

type Item = <T::Target as TryRwLock<'a>>::Item

type ReadGuard = <T::Target as TryRwLock<'a>>::ReadGuard

type WriteGuard = <T::Target as TryRwLock<'a>>::WriteGuard

Loading content...

Implementors

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

type Item = T

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

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

Loading content...