Struct Flock
struct Flock<T: Flockable>(_)
Represents an owned flock, which unlocks on drop.
See flock(2) for details on locking semantics.
Implementations
impl<T: Flockable> Flock<T>
fn lock(t: T, args: FlockArg) -> Result<Self, (T, Errno)>Obtain a/an flock.
Example
# use Write; # use File; # use ; #fn unlock(self: Self) -> Result<T, (Self, Errno)>Remove the lock and return the object wrapped within.
Example
# use File; # use ;fn relock(self: &Self, arg: FlockArg) -> Result<()>Relock the file. This can upgrade or downgrade the lock type.
Example
# use File; # use ; # use tempfile; let f: File = tempfile.unwrap; let locked_file = lock.unwrap; // Do stuff, then downgrade the lock locked_file.relock.unwrap;
impl<P, T> Receiver for Flock<T>
impl<T> Any for Flock<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Flock<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Flock<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> Freeze for Flock<T>
impl<T> From for Flock<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> RefUnwindSafe for Flock<T>
impl<T> Send for Flock<T>
impl<T> Sync for Flock<T>
impl<T> Unpin for Flock<T>
impl<T> UnsafeUnpin for Flock<T>
impl<T> UnwindSafe for Flock<T>
impl<T, U> Into for Flock<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Flock<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Flock<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::fmt::Debug + Flockable> Debug for Flock<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: Flockable> Deref for Flock<T>
fn deref(self: &Self) -> &<Self as >::Target
impl<T: Flockable> DerefMut for Flock<T>
fn deref_mut(self: &mut Self) -> &mut <Self as >::Target
impl<T: Flockable> Drop for Flock<T>
fn drop(self: &mut Self)