pub struct Locked<T: FileLike>(/* private fields */);
Expand description
Locks a file securely (requires lockf
)
This version takes ownership of the protected resource.
Not reentrant on Linux. That is, even the same thread cannot acquire the same file twice. BUT if there are two copies of this software in the same process, those copies can both lock the same file. This can happen if two different versions of the library are used, for example.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Locked<T>where
T: Freeze,
impl<T> RefUnwindSafe for Locked<T>where
T: RefUnwindSafe,
impl<T> Send for Locked<T>where
T: Send,
impl<T> Sync for Locked<T>where
T: Sync,
impl<T> Unpin for Locked<T>where
T: Unpin,
impl<T> UnwindSafe for Locked<T>where
T: UnwindSafe,
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