pub enum LockType {
Mutex,
RwLockRead,
RwLockWrite,
RefCell,
RefCellMut,
ParkingLotMutex,
ParkingLotRwLock,
TokioMutex,
TokioRwLock,
}Expand description
Type of lock primitive.
Variants§
Mutex
std::sync::Mutex
RwLockRead
std::sync::RwLock (read guard)
RwLockWrite
std::sync::RwLock (write guard)
RefCell
std::cell::RefCell (single-threaded)
RefCellMut
std::cell::RefCell (mutable borrow)
ParkingLotMutex
parking_lot::Mutex
ParkingLotRwLock
parking_lot::RwLock
TokioMutex
tokio::sync::Mutex
TokioRwLock
tokio::sync::RwLock
Implementations§
Source§impl LockType
impl LockType
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Check if this is a read-only lock.
Sourcepub fn is_exclusive(&self) -> bool
pub fn is_exclusive(&self) -> bool
Check if this is a write/exclusive lock.
Trait Implementations§
impl Copy for LockType
impl Eq for LockType
impl StructuralPartialEq for LockType
Auto Trait Implementations§
impl Freeze for LockType
impl RefUnwindSafe for LockType
impl Send for LockType
impl Sync for LockType
impl Unpin for LockType
impl UnsafeUnpin for LockType
impl UnwindSafe for LockType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more