Struct wgpu_core::lock::ranked::LockStateGuard
source · struct LockStateGuard(LockState);
Expand description
A container that restores a LockState
when dropped.
This type serves two purposes:
-
Operations like
RwLockWriteGuard::downgrade
would 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 pointlessOption
s whose state is almost always statically known. -
We can just implement
Drop
for this type once, and then use it in lock guards, rather than implementingDrop
separately for each guard type.
Tuple Fields§
§0: LockState
Trait 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