#[repr(transparent)]pub struct FlockLock<T> where
T: FlockElement + WaitFlockUnlock, { /* private fields */ }
Expand description
Type for securely creating and securely managing ‘flock’ locks.
Implementations
sourceimpl<T> FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourcepub unsafe fn new(t: T) -> Self
👎 Deprecated since 1.2.6: please use force_new
instead
pub unsafe fn new(t: T) -> Self
please use force_new
instead
Create lock surveillance structure, unsafe because it is not known if a lock has been created before.
sourcepub unsafe fn force_new(data: T) -> Self
pub unsafe fn force_new(data: T) -> Self
Create lock surveillance structure, unsafe because it is not known if a lock has been created before.
pub fn wait_exclusive_lock(data: T) -> Result<FlockLock<T>, FlockError<T>> where
T: ExclusiveFlock,
pub fn try_exclusive_lock(data: T) -> Result<FlockLock<T>, FlockError<T>> where
T: ExclusiveFlock,
pub fn wait_exclusive_lock_fn<F: FnOnce(FlockLock<T>) -> R, FE: FnOnce(FlockError<T>) -> R, R>(
data: T,
next: F,
errf: FE
) -> R where
T: ExclusiveFlock,
pub fn try_exclusive_lock_fn<F: FnOnce(FlockLock<T>) -> R, FE: FnOnce(FlockError<T>) -> R, R>(
data: T,
next: F,
errf: FE
) -> R where
T: ExclusiveFlock,
pub fn as_ptr(&self) -> *const T
pub fn as_mut_ptr(&mut self) -> *mut T
sourcepub fn unlock_fn<F: FnOnce() -> R, FE: FnOnce(Error) -> R, R>(
self,
next: F,
errf: FE
) -> R
pub fn unlock_fn<F: FnOnce() -> R, FE: FnOnce(Error) -> R, R>(
self,
next: F,
errf: FE
) -> R
Destroy the ‘flock’ lock, return a good result or error.
sourcepub fn unlock(self) -> Result<(), Error>
pub fn unlock(self) -> Result<(), Error>
Destroy the ‘flock’ lock, return a good result or error.
sourcepub fn unlock_no_err_result(self)
pub fn unlock_no_err_result(self)
Destroy the ‘flock’ lock, return a good result or error.
sourcepub fn data_unlock(self) -> (T, Result<(), Error>)
pub fn data_unlock(self) -> (T, Result<(), Error>)
Destroy the “flock” lock, return data and error data.
sourcepub fn data_unlock_fn<F: FnOnce() -> R, FE: FnOnce(Error) -> R, R>(
self,
next: F,
errf: FE
) -> (T, R)
pub fn data_unlock_fn<F: FnOnce() -> R, FE: FnOnce(Error) -> R, R>(
self,
next: F,
errf: FE
) -> (T, R)
Destroy the “flock” lock, return data and error data.
sourcepub fn data_unlock_no_err_result(self) -> T
pub fn data_unlock_no_err_result(self) -> T
Destroy the “flock” lock, return data.
Trait Implementations
sourceimpl<T> AsMut<T> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> AsMut<T> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T> AsRef<T> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> AsRef<T> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T: Clone> Clone for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T: Clone> Clone for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T> Debug for FlockLock<T> where
T: Debug + FlockElement + WaitFlockUnlock,
impl<T> Debug for FlockLock<T> where
T: Debug + FlockElement + WaitFlockUnlock,
sourceimpl<T: Default> Default for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T: Default> Default for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T> Deref for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> Deref for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T> DerefMut for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> DerefMut for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T> Drop for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> Drop for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T: Hash> Hash for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T: Hash> Hash for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T: Ord> Ord for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T: Ord> Ord for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T: PartialEq> PartialEq<FlockLock<T>> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T: PartialEq> PartialEq<FlockLock<T>> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourceimpl<T: PartialOrd> PartialOrd<FlockLock<T>> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T: PartialOrd> PartialOrd<FlockLock<T>> for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
sourcefn partial_cmp(&self, other: &FlockLock<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &FlockLock<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T: Eq> Eq for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> StructuralEq for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
impl<T> StructuralPartialEq for FlockLock<T> where
T: FlockElement + WaitFlockUnlock,
Auto Trait Implementations
impl<T> RefUnwindSafe for FlockLock<T> where
T: RefUnwindSafe,
impl<T> Send for FlockLock<T> where
T: Send,
impl<T> Sync for FlockLock<T> where
T: Sync,
impl<T> Unpin for FlockLock<T> where
T: Unpin,
impl<T> UnwindSafe for FlockLock<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more