pub struct OwnedFileLockGuard { /* private fields */ }Expand description
A guard that owns its FileLock and releases the lock when dropped.
Unlike FileLockGuard, this guard does not borrow the FileLock, so it
has no lifetime and can be stored in long-lived structures or moved across
threads and tasks. It is returned by FileLock::lock_owned and related
methods.
Implementations§
Source§impl OwnedFileLockGuard
impl OwnedFileLockGuard
Sourcepub fn file(&self) -> &File ⓘ
pub fn file(&self) -> &File ⓘ
Returns a reference to the underlying lock file.
This can be used to read or write auxiliary data stored in the lock file, such as the holder’s process id, while the lock is held.
On Rust 1.89 and newer the returned reference also exposes the standard
library’s locking methods (such as File::unlock). Do not call them
through this reference: they act on the same underlying lock and would
release it while this guard still believes it is held.
Trait Implementations§
Source§impl Drop for OwnedFileLockGuard
impl Drop for OwnedFileLockGuard
Auto Trait Implementations§
impl Freeze for OwnedFileLockGuard
impl RefUnwindSafe for OwnedFileLockGuard
impl Send for OwnedFileLockGuard
impl Sync for OwnedFileLockGuard
impl Unpin for OwnedFileLockGuard
impl UnsafeUnpin for OwnedFileLockGuard
impl UnwindSafe for OwnedFileLockGuard
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