[][src]Struct try_rwlock::TryRwLock

pub struct TryRwLock<T> { /* fields omitted */ }

A readers-writer lock.

Implementations

impl<T> TryRwLock<T>[src]

#[must_use]pub const fn new(data: T) -> Self[src]

Create a new unlocked TryRwLock<T>.

pub fn try_read(&self) -> Option<ReadGuard<'_, T>>[src]

Attempt to lock this TryRwLock with shared read access.

If the lock is currently being written to or there are usize::MAX existing readers, this function will return None.

pub fn try_write(&self) -> Option<WriteGuard<'_, T>>[src]

Attempt to lock this TryRwLock with unique write access.

If the lock is currently being written to or read from, this function will return None.

#[must_use]pub fn into_inner(self) -> T[src]

Get the underlying data of the lock.

#[must_use]pub fn get_mut(&mut self) -> &mut T[src]

Get a mutable reference to the underlying data.

As this method takes a mutable reference, no locking needs to take place.

Trait Implementations

impl<T: Debug> Debug for TryRwLock<T>[src]

impl<T: Default> Default for TryRwLock<T>[src]

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

impl<T: Send> Send for TryRwLock<T>[src]

impl<T: Send + Sync> Sync for TryRwLock<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for TryRwLock<T>

impl<T> Unpin for TryRwLock<T> where
    T: Unpin

impl<T> UnwindSafe for TryRwLock<T> where
    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.