pub struct WriterLock { /* private fields */ }Expand description
The workspace writer lock (writer.lock), released on drop.
Implementations§
Source§impl WriterLock
impl WriterLock
Sourcepub fn try_acquire(omgbase_dir: &Path) -> Result<Option<Self>>
pub fn try_acquire(omgbase_dir: &Path) -> Result<Option<Self>>
Take the lock without waiting; None when a live writer holds it.
Sourcepub fn acquire(omgbase_dir: &Path, opts: WriterLockOptions) -> Result<Self>
pub fn acquire(omgbase_dir: &Path, opts: WriterLockOptions) -> Result<Self>
Take the lock, polling until free or the timeout elapses
(Error::WriterLockTimeout naming the holder).
Sourcepub fn is_free(omgbase_dir: &Path) -> bool
pub fn is_free(omgbase_dir: &Path) -> bool
Whether no live writer holds the lock (a probe; acquires nothing).
pub fn path(&self) -> &Path
Trait Implementations§
Source§impl Debug for WriterLock
impl Debug for WriterLock
Source§impl Drop for WriterLock
impl Drop for WriterLock
Auto Trait Implementations§
impl Freeze for WriterLock
impl RefUnwindSafe for WriterLock
impl Send for WriterLock
impl Sync for WriterLock
impl Unpin for WriterLock
impl UnsafeUnpin for WriterLock
impl UnwindSafe for WriterLock
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