[][src]Trait raw_sync::locks::LockImpl

pub trait LockImpl {
    fn as_raw(&self) -> *mut c_void;
fn lock(&self) -> Result<LockGuard, Box<dyn Error>>;
fn try_lock(&self, timeout: Timeout) -> Result<LockGuard, Box<dyn Error>>;
fn release(&self) -> Result<(), Box<dyn Error>>; fn rlock(&self) -> Result<ReadLockGuard, Box<dyn Error>> { ... }
fn try_rlock(
        &self,
        timeout: Timeout
    ) -> Result<ReadLockGuard, Box<dyn Error>> { ... } }

Required methods

fn as_raw(&self) -> *mut c_void

fn lock(&self) -> Result<LockGuard, Box<dyn Error>>

Acquires the lock

fn try_lock(&self, timeout: Timeout) -> Result<LockGuard, Box<dyn Error>>

Acquires lock with timeout

fn release(&self) -> Result<(), Box<dyn Error>>

Release the lock

Loading content...

Provided methods

fn rlock(&self) -> Result<ReadLockGuard, Box<dyn Error>>

Acquires the lock for read access only. This method uses lock() as a fallback

fn try_rlock(&self, timeout: Timeout) -> Result<ReadLockGuard, Box<dyn Error>>

Acquires the lock for read access only with timeout. This method uses lock() as a fallback

Loading content...

Implementors

impl LockImpl for Mutex[src]

impl LockImpl for RwLock[src]

Loading content...