pub struct Lockfile { /* private fields */ }Implementations§
Source§impl Lockfile
impl Lockfile
Sourcepub fn try_acquire(path: &Path, kind: LockKind) -> Result<Option<Self>>
pub fn try_acquire(path: &Path, kind: LockKind) -> Result<Option<Self>>
Acquire an exclusive advisory lock at path without blocking.
Returns Ok(Some(Lockfile)) if acquired, Ok(None) if the lock is
already held by another process.
Sourcepub fn is_held_by_other(path: &Path) -> Result<bool>
pub fn is_held_by_other(path: &Path) -> Result<bool>
Probe whether the lock is currently free, without holding it on success. Useful for readers that want to skip backfill when a writer is active.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lockfile
impl RefUnwindSafe for Lockfile
impl Send for Lockfile
impl Sync for Lockfile
impl Unpin for Lockfile
impl UnsafeUnpin for Lockfile
impl UnwindSafe for Lockfile
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