pub struct ScopedDirLock { /* private fields */ }Expand description
Prove that a directory was locked.
Implementations§
Source§impl ScopedDirLock
impl ScopedDirLock
Sourcepub fn new(path: &Path) -> Result<Self>
pub fn new(path: &Path) -> Result<Self>
Lock the given directory with default options (exclusive, blocking).
Sourcepub fn new_with_options(dir: &Path, opts: &DirLockOptions) -> Result<Self>
pub fn new_with_options(dir: &Path, opts: &DirLockOptions) -> Result<Self>
Lock the given directory with advanced options.
opts.file_name: decides the lock file name. A directory can have multiple locks independent from one another using differentfile_names.opts.non_blocking: if true, do not wait and return an error if lock cannot be obtained; if false, wait forever for the lock to be available.opts.exclusive: if true, ensure that no other locks are present for for the (dir, file_name); if false, allow other non-exclusive locks to co-exist.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopedDirLock
impl RefUnwindSafe for ScopedDirLock
impl Send for ScopedDirLock
impl Sync for ScopedDirLock
impl Unpin for ScopedDirLock
impl UnwindSafe for ScopedDirLock
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