pub struct FileLock { /* private fields */ }Expand description
Holds an exclusive lock. Released on Drop.
Implementations§
Source§impl FileLock
impl FileLock
Sourcepub fn acquire(path: &Path, timeout: Duration) -> KitResult<Self>
pub fn acquire(path: &Path, timeout: Duration) -> KitResult<Self>
Acquires the lock, waiting at most timeout.
§Errors
KitError::LockTimeout: another holder still has it when the timeout expires.KitError::LockIo: an IO error, or the lock file’s parent directory could not be created.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileLock
impl RefUnwindSafe for FileLock
impl Send for FileLock
impl Sync for FileLock
impl Unpin for FileLock
impl UnsafeUnpin for FileLock
impl UnwindSafe for FileLock
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