pub struct FileLock { /* private fields */ }Expand description
A held lock; released when dropped.
Implementations§
Source§impl FileLock
impl FileLock
Sourcepub fn try_acquire(path: &Path) -> Result<Self, LockError>
pub fn try_acquire(path: &Path) -> Result<Self, LockError>
Try once; returns LockError::Held if a live holder has the lock.
Sourcepub fn acquire_with_wait(
path: &Path,
budget: Duration,
) -> Result<Self, LockError>
pub fn acquire_with_wait( path: &Path, budget: Duration, ) -> Result<Self, LockError>
Block until the lock is acquired, a stale holder is taken over, or
budget elapses.
Sourcepub fn stripe_lock_path(definition_dir: &Path) -> PathBuf
pub fn stripe_lock_path(definition_dir: &Path) -> PathBuf
{state_dir}/locks/stripe/{digest}.lock for a definition dir.
Sourcepub fn git_cache_lock_path(cache_key: &str) -> PathBuf
pub fn git_cache_lock_path(cache_key: &str) -> PathBuf
{state_dir}/locks/git-cache/{cache_key}.lock.
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