[][src]Struct libra_infallible::RwLock

pub struct RwLock<T>(_);

A simple wrapper around the lock() function of a std::sync::RwLock The only difference is that you don't need to call unwrap() on it.


impl<T> RwLock<T>[src]

pub fn new(t: T) -> Self[src]

creates a read-write lock

pub fn read(&self) -> RwLockReadGuard<'_, T>[src]

lock the rwlock in read mode

pub fn write(&self) -> RwLockWriteGuard<'_, T>[src]

lock the rwlock in write mode

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

return the owned type consuming the lock

Trait Implementations

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

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

Auto Trait Implementations

impl<T> RefUnwindSafe for RwLock<T>

impl<T> Send for RwLock<T> where
    T: Send

impl<T> Sync for RwLock<T> where
    T: Send + Sync

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

impl<T> UnwindSafe for RwLock<T>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.