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§
Sourcefn status(&self) -> SimpleLockResult<LockStatus>
fn status(&self) -> SimpleLockResult<LockStatus>
None if unknown, otherwise will contain the status.
Sourcefn lock(&mut self) -> SimpleLockResult<()>
fn lock(&mut self) -> SimpleLockResult<()>
Attempt to perform the lock.
Sourcefn unlock(&mut self) -> SimpleLockResult<()>
fn unlock(&mut self) -> SimpleLockResult<()>
Attempt to perform the unlock.
Trait Implementations§
Source§impl Lock for Box<dyn Lock>
impl Lock for Box<dyn Lock>
Source§fn status(&self) -> SimpleLockResult<LockStatus>
fn status(&self) -> SimpleLockResult<LockStatus>
None if unknown, otherwise will contain the status.
Source§fn lock(&mut self) -> SimpleLockResult<()>
fn lock(&mut self) -> SimpleLockResult<()>
Attempt to perform the lock.
Source§fn unlock(&mut self) -> SimpleLockResult<()>
fn unlock(&mut self) -> SimpleLockResult<()>
Attempt to perform the unlock.