pub struct RootLock { /* private fields */ }Implementations§
Source§impl RootLock
impl RootLock
Sourcepub fn acquire(root: &Path) -> Result<Self>
pub fn acquire(root: &Path) -> Result<Self>
Acquire an exclusive lock at <root>/.secunit.lock. Blocks until
the previous holder releases. Drop the returned guard to release.
Sourcepub fn try_acquire(root: &Path) -> Result<Option<Self>>
pub fn try_acquire(root: &Path) -> Result<Option<Self>>
Try to acquire the lock without blocking. Returns Ok(None) if
another process holds it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RootLock
impl RefUnwindSafe for RootLock
impl Send for RootLock
impl Sync for RootLock
impl Unpin for RootLock
impl UnsafeUnpin for RootLock
impl UnwindSafe for RootLock
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