Struct std::sync::rwlock::RwLock [] [src]

pub struct RwLock<T: ?Sized> {
    inner: Mutex<RwLockInner>,
    value: UnsafeCell<T>,
}

Fields

inner
value

Methods

impl<T> RwLock<T>

fn new(value: T) -> Self

Create a new mutex with value value.

impl<T: ?Sized> RwLock<T>

fn read(&self) -> RwLockReadGuard<T>

Lock for read

fn write(&self) -> RwLockWriteGuard<T>

Lock for write

Trait Implementations

impl<T: ?Sized + Send> Send for RwLock<T>

impl<T: ?Sized + Send> Sync for RwLock<T>