pub struct SemaphoreLock { /* private fields */ }
Expand description
A safe publicly usable object surrounding the wrapper we built since ‘nix’ doesn’t have it yet.
Implementations§
Source§impl SemaphoreLock
impl SemaphoreLock
Sourcepub fn new(name: impl Into<String>) -> SimpleLockResult<SemaphoreLock>
pub fn new(name: impl Into<String>) -> SimpleLockResult<SemaphoreLock>
Create a new lock with the given semaphore name. Must meet POSIX requirements.
Trait Implementations§
Source§impl ConcreteLock for SemaphoreLock
impl ConcreteLock for SemaphoreLock
Source§fn status(&self) -> SimpleLockResult<LockStatus>
fn status(&self) -> SimpleLockResult<LockStatus>
Get the currently known lock status.
Source§fn try_lock(&mut self) -> SimpleLockResult<()>
fn try_lock(&mut self) -> SimpleLockResult<()>
Attempt to perform the lock.
Source§fn hang_lock(&mut self) -> SimpleLockResult<()>
fn hang_lock(&mut self) -> SimpleLockResult<()>
Attempt to perform the lock and hang until acquire.
Source§fn try_unlock(&mut self) -> SimpleLockResult<()>
fn try_unlock(&mut self) -> SimpleLockResult<()>
Attempt to perform the unlock.
Auto Trait Implementations§
impl Freeze for SemaphoreLock
impl RefUnwindSafe for SemaphoreLock
impl !Send for SemaphoreLock
impl !Sync for SemaphoreLock
impl Unpin for SemaphoreLock
impl UnwindSafe for SemaphoreLock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more