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
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
Implementors
impl<'a, T, R> TryRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTryRwLock + 'a,
[src]
impl<'a, T, R> TryRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTryRwLock + 'a,
[src]