pub struct FileLock { /* private fields */ }Expand description
RAII guard around an advisory lock on a sidecar lock file.
The lock is released when the guard is dropped (and, as a backstop, by the operating system when the process exits — so a crashed writer never leaves a database permanently locked).
Implementations§
Source§impl FileLock
impl FileLock
Sourcepub fn acquire<P: AsRef<Path>>(
lock_path: P,
mode: LockMode,
) -> Result<Self, LinkError>
pub fn acquire<P: AsRef<Path>>( lock_path: P, mode: LockMode, ) -> Result<Self, LinkError>
Acquires the lock, blocking until it becomes available.
Trait Implementations§
Auto Trait Implementations§
impl Forget for FileLock
impl Freeze for FileLock
impl Move for FileLock
impl RefUnwindSafe for FileLockwhere
I32NotAllOnes: RefUnwindSafe,
impl Send for FileLock
impl Sync for FileLock
impl Unpin for FileLock
impl UnsafeUnpin for FileLock
impl UnwindSafe for FileLockwhere
I32NotAllOnes: UnwindSafe,
RawVecInner: UnwindSafe,
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