Struct pikadick_util::AsyncLockFile
source · 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 copy 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 !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