pub struct AsyncLockFile { /* private fields */ }Expand description
An async LockFile.
Implemented by blocking on the tokio threadpool
Implementations§
Source§impl AsyncLockFile
impl AsyncLockFile
Sourcepub fn blocking_open<P>(path: &P) -> Result<Self>where
P: ToOsStr + ?Sized,
pub fn blocking_open<P>(path: &P) -> Result<Self>where
P: ToOsStr + ?Sized,
Open a file for locking in a blocking manner
Sourcepub async fn lock_with_pid(&self) -> Result<()>
pub async fn lock_with_pid(&self) -> Result<()>
Lock the file, writing the PID to it
Sourcepub async fn try_lock(&self) -> Result<bool>
pub async fn try_lock(&self) -> Result<bool>
Try to lock the file, returning true if successful.
Sourcepub async fn try_lock_with_pid(&self) -> Result<bool>
pub async fn try_lock_with_pid(&self) -> Result<bool>
Try to lock a file with a pid, returning true if successful.
Sourcepub fn try_lock_with_pid_blocking(&self) -> Result<bool>
pub fn try_lock_with_pid_blocking(&self) -> Result<bool>
Try to lock a file with a pid, returning true if successful in a blocking manner.
Sourcepub fn blocking_unlock(&self) -> Result<()>
pub fn blocking_unlock(&self) -> Result<()>
Unlock the file in a blocking manner
Trait Implementations§
Source§impl Clone for AsyncLockFile
impl Clone for AsyncLockFile
Source§fn clone(&self) -> AsyncLockFile
fn clone(&self) -> AsyncLockFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AsyncLockFile
impl !RefUnwindSafe for AsyncLockFile
impl Send for AsyncLockFile
impl Sync for AsyncLockFile
impl Unpin for AsyncLockFile
impl !UnwindSafe for AsyncLockFile
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