Trait Lock

Source
pub trait Lock {
    // Required methods
    fn status(&self) -> SimpleLockResult<LockStatus>;
    fn lock(&mut self) -> SimpleLockResult<()>;
    fn unlock(&mut self) -> SimpleLockResult<()>;
}
Expand description

The Simple Lock trait.

Required Methods§

Source

fn status(&self) -> SimpleLockResult<LockStatus>

None if unknown, otherwise will contain the status.

Source

fn lock(&mut self) -> SimpleLockResult<()>

Attempt to perform the lock.

Source

fn unlock(&mut self) -> SimpleLockResult<()>

Attempt to perform the unlock.

Trait Implementations§

Source§

impl Lock for Box<dyn Lock>

Source§

fn status(&self) -> SimpleLockResult<LockStatus>

None if unknown, otherwise will contain the status.
Source§

fn lock(&mut self) -> SimpleLockResult<()>

Attempt to perform the lock.
Source§

fn unlock(&mut self) -> SimpleLockResult<()>

Attempt to perform the unlock.

Implementations on Foreign Types§

Source§

impl Lock for Box<dyn Lock>

Implementors§