pub struct SessionLock { /* private fields */ }Expand description
RAII guard that removes the lockfile when dropped, provided the lockfile
still belongs to this process. A Drop that blindly removed the file
would delete another session’s lock if two processes raced the acquire.
Note: the RAII guard only guarantees correct cleanup on drop. It does
not guarantee ongoing exclusive access — if another process bypasses
acquire and clobbers the file mid-session, this guard will not notice,
though Drop will correctly refuse to remove a file whose PID no longer
matches.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionLock
impl RefUnwindSafe for SessionLock
impl Send for SessionLock
impl Sync for SessionLock
impl Unpin for SessionLock
impl UnsafeUnpin for SessionLock
impl UnwindSafe for SessionLock
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