pub struct OrderedRwLock<T, L: LockAfter<UninterruptibleLock>> { /* private fields */ }
Expand description
A wrapper for an RwLock that requires a Locked
context to acquire.
This context must be of a level that precedes L
in the lock ordering graph
where L
is a level associated with this RwLock.
Implementations§
Source§impl<T, L: LockAfter<UninterruptibleLock>> OrderedRwLock<T, L>
impl<T, L: LockAfter<UninterruptibleLock>> OrderedRwLock<T, L>
pub const fn new(t: T) -> Self
pub fn read<'a, P>(
&'a self,
locked: &'a mut Locked<'_, P>,
) -> <Self as RwLockFor<L>>::ReadGuard<'a>where
P: LockBefore<L>,
pub fn write<'a, P>(
&'a self,
locked: &'a mut Locked<'_, P>,
) -> <Self as RwLockFor<L>>::WriteGuard<'a>where
P: LockBefore<L>,
pub fn read_and<'a, P>(
&'a self,
locked: &'a mut Locked<'_, P>,
) -> (<Self as RwLockFor<L>>::ReadGuard<'a>, Locked<'a, L>)where
P: LockBefore<L>,
pub fn write_and<'a, P>(
&'a self,
locked: &'a mut Locked<'_, P>,
) -> (<Self as RwLockFor<L>>::WriteGuard<'a>, Locked<'a, L>)where
P: LockBefore<L>,
Trait Implementations§
Source§impl<T: Debug, L: LockAfter<UninterruptibleLock>> Debug for OrderedRwLock<T, L>
impl<T: Debug, L: LockAfter<UninterruptibleLock>> Debug for OrderedRwLock<T, L>
Source§impl<T: Default, L: LockAfter<UninterruptibleLock>> Default for OrderedRwLock<T, L>
impl<T: Default, L: LockAfter<UninterruptibleLock>> Default for OrderedRwLock<T, L>
Source§impl<T, L: LockAfter<UninterruptibleLock>> RwLockFor<L> for OrderedRwLock<T, L>
impl<T, L: LockAfter<UninterruptibleLock>> RwLockFor<L> for OrderedRwLock<T, L>
Source§type ReadGuard<'a> = RwLockReadGuard<'a, TracingWrapper<RawSyncRwLock>, T>
where
T: 'a,
L: 'a
type ReadGuard<'a> = RwLockReadGuard<'a, TracingWrapper<RawSyncRwLock>, T> where T: 'a, L: 'a
A guard providing read access to the data.
Source§type WriteGuard<'a> = RwLockWriteGuard<'a, TracingWrapper<RawSyncRwLock>, T>
where
T: 'a,
L: 'a
type WriteGuard<'a> = RwLockWriteGuard<'a, TracingWrapper<RawSyncRwLock>, T> where T: 'a, L: 'a
A guard providing write access to the data.
Source§fn read_lock(&self) -> Self::ReadGuard<'_>
fn read_lock(&self) -> Self::ReadGuard<'_>
Acquires a read lock on the data in
Self
indicated by L
.Source§fn write_lock(&self) -> Self::WriteGuard<'_>
fn write_lock(&self) -> Self::WriteGuard<'_>
Acquires a write lock on the data in
Self
indicated by L
.Auto Trait Implementations§
impl<T, L> !Freeze for OrderedRwLock<T, L>
impl<T, L> !RefUnwindSafe for OrderedRwLock<T, L>
impl<T, L> Send for OrderedRwLock<T, L>
impl<T, L> Sync for OrderedRwLock<T, L>
impl<T, L> Unpin for OrderedRwLock<T, L>
impl<T, L> UnwindSafe for OrderedRwLock<T, L>where
L: UnwindSafe,
T: UnwindSafe,
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