pub struct Lock<'a, T: FileLike>(/* private fields */);
Expand description
Locks a file securely (requires lockf
)
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<'a, T> Freeze for Lock<'a, T>
impl<'a, T> RefUnwindSafe for Lock<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Lock<'a, T>where
T: Sync,
impl<'a, T> Sync for Lock<'a, T>where
T: Sync,
impl<'a, T> Unpin for Lock<'a, T>
impl<'a, T> UnwindSafe for Lock<'a, T>where
T: RefUnwindSafe,
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