pub struct DirLock { /* private fields */ }Expand description
An advisory file lock scoped to a directory.
The lock is acquired on creation and released when the guard is dropped.
This uses fs2 advisory locking which coordinates between cooperating
processes — it does not prevent non-cooperating processes from
accessing the directory.
§Example
use std::path::Path;
use aperture_cli::atomic::DirLock;
let lock = DirLock::acquire(Path::new("/tmp/cache")).unwrap();
// … perform cache operations …
drop(lock); // lock is releasedImplementations§
Auto Trait Implementations§
impl Freeze for DirLock
impl RefUnwindSafe for DirLock
impl Send for DirLock
impl Sync for DirLock
impl Unpin for DirLock
impl UnsafeUnpin for DirLock
impl UnwindSafe for DirLock
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