pub struct PoolLock { /* private fields */ }Expand description
A held file lock on the pool
Implementations§
Source§impl PoolLock
impl PoolLock
Sourcepub fn acquire(pool_dir: &Path) -> Result<Self>
pub fn acquire(pool_dir: &Path) -> Result<Self>
Acquire an exclusive lock on the pool directory with retry. Creates the pool directory and lock file if they don’t exist. Retries for up to 10 seconds before returning PoolLockTimeout.
Sourcepub fn acquire_with_timeout(pool_dir: &Path, timeout: Duration) -> Result<Self>
pub fn acquire_with_timeout(pool_dir: &Path, timeout: Duration) -> Result<Self>
Acquire an exclusive lock with a custom timeout.
Auto Trait Implementations§
impl Freeze for PoolLock
impl RefUnwindSafe for PoolLock
impl Send for PoolLock
impl Sync for PoolLock
impl Unpin for PoolLock
impl UnsafeUnpin for PoolLock
impl UnwindSafe for PoolLock
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