pub struct FileLock { /* private fields */ }Expand description
A held exclusive file lock. Released on drop.
Implementations§
Source§impl FileLock
impl FileLock
Sourcepub fn try_acquire(path: &Path) -> Result<Option<FileLock>>
pub fn try_acquire(path: &Path) -> Result<Option<FileLock>>
Non-blocking. Ok(Some) if acquired now, Ok(None) if another holder has it.
Sourcepub fn acquire_blocking(path: &Path) -> Result<FileLock>
pub fn acquire_blocking(path: &Path) -> Result<FileLock>
Blocks until acquired. Use only watcher-to-watcher; interactive callers use
FileLock::acquire_timeout so a hung holder can’t hang git checkout.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more