pub struct ProjectLock { /* private fields */ }Expand description
A file-based project lock that provides mutual exclusion for save/restore/delete operations.
The lock is held by keeping an exclusive flock on a project.lock file.
When the ProjectLock is dropped, the file is closed and the lock is
automatically released.
Implementations§
Source§impl ProjectLock
impl ProjectLock
Sourcepub fn acquire(lock_dir: &Path) -> Result<ProjectLock>
pub fn acquire(lock_dir: &Path) -> Result<ProjectLock>
Acquire an exclusive project lock.
Creates (or opens) lock_dir/project.lock and attempts to take an
exclusive lock on it. Returns ChkpttError::LockHeld if another process
already holds the lock.
Auto Trait Implementations§
impl Freeze for ProjectLock
impl RefUnwindSafe for ProjectLock
impl Send for ProjectLock
impl Sync for ProjectLock
impl Unpin for ProjectLock
impl UnsafeUnpin for ProjectLock
impl UnwindSafe for ProjectLock
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