pub enum RwLockAnyGuardKey<'lock, 'guard, T, K> {
Read((RwLockReadGuard<'lock, T>, &'lock K)),
Write(&'guard (RwLockWriteGuard<'lock, T>, &'lock K)),
}
Expand description
Generic enum for a shared key, can hold a RwLockWriteGuard
or RwLockReadGuard
as
both should be possible to be used for shared access, along with the key accessed itself.
Hacky solution for the DumbTryThreadSafeWrapper
.
Variants§
Read((RwLockReadGuard<'lock, T>, &'lock K))
Write(&'guard (RwLockWriteGuard<'lock, T>, &'lock K))
Implementations§
Trait Implementations§
Source§impl<T, K> Deref for RwLockAnyGuardKey<'_, '_, T, K>
impl<T, K> Deref for RwLockAnyGuardKey<'_, '_, T, K>
Source§impl<'lock, 'guard, T, K> From<&'guard (RwLockWriteGuard<'lock, T>, &'lock K)> for RwLockAnyGuardKey<'lock, 'guard, T, K>
impl<'lock, 'guard, T, K> From<&'guard (RwLockWriteGuard<'lock, T>, &'lock K)> for RwLockAnyGuardKey<'lock, 'guard, T, K>
Source§fn from(value: &'guard (RwLockWriteGuard<'lock, T>, &'lock K)) -> Self
fn from(value: &'guard (RwLockWriteGuard<'lock, T>, &'lock K)) -> Self
Converts to this type from the input type.
Source§impl<'lock, T, K> From<(RwLockReadGuard<'lock, T>, &'lock K)> for RwLockAnyGuardKey<'lock, '_, T, K>
impl<'lock, T, K> From<(RwLockReadGuard<'lock, T>, &'lock K)> for RwLockAnyGuardKey<'lock, '_, T, K>
Source§fn from(value: (RwLockReadGuard<'lock, T>, &'lock K)) -> Self
fn from(value: (RwLockReadGuard<'lock, T>, &'lock K)) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'lock, 'guard, T, K> Freeze for RwLockAnyGuardKey<'lock, 'guard, T, K>
impl<'lock, 'guard, T, K> RefUnwindSafe for RwLockAnyGuardKey<'lock, 'guard, T, K>where
K: RefUnwindSafe,
T: RefUnwindSafe,
impl<'lock, 'guard, T, K> !Send for RwLockAnyGuardKey<'lock, 'guard, T, K>
impl<'lock, 'guard, T, K> Sync for RwLockAnyGuardKey<'lock, 'guard, T, K>
impl<'lock, 'guard, T, K> Unpin for RwLockAnyGuardKey<'lock, 'guard, T, K>
impl<'lock, 'guard, T, K> UnwindSafe for RwLockAnyGuardKey<'lock, 'guard, T, K>where
K: RefUnwindSafe,
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