pub struct LockFile { /* private fields */ }Expand description
A PID-based lockfile for mutual exclusion.
Implementations§
Source§impl LockFile
impl LockFile
Sourcepub fn acquire(path: &Path) -> Result<Self, CoreError>
pub fn acquire(path: &Path) -> Result<Self, CoreError>
Try to acquire the lockfile. Returns error if already locked by a running process.
Sourcepub fn try_acquire(path: &Path) -> Option<Self>
pub fn try_acquire(path: &Path) -> Option<Self>
Try to acquire the lockfile, returning None if already locked (instead of an error). Used by –auto mode to silently skip when another process is running.
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