struct LockStateGuard(LockState);Expand description
A container that restores a LockState when dropped.
This type serves two purposes:
-
Operations like
RwLockWriteGuard::downgradewould like to be able to destructure lock guards and reassemble their pieces into new guards, but if the guard type itself implementsDrop, we can’t destructure it without unsafe code or pointlessOptions whose state is almost always statically known. -
We can just implement
Dropfor this type once, and then use it in lock guards, rather than implementingDropseparately for each guard type.
Tuple Fields§
§0: LockStateTrait Implementations§
Auto Trait Implementations§
impl Freeze for LockStateGuard
impl RefUnwindSafe for LockStateGuard
impl Send for LockStateGuard
impl Sync for LockStateGuard
impl Unpin for LockStateGuard
impl UnwindSafe for LockStateGuard
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