pub struct MutexGuard { /* private fields */ }Expand description
RAII guard returned by Mutex::lock_guard. Unlocks on Drop.
Stores a [BackRef<Mutex>] (lifetime-erased &Mutex) so it does not hold
a borrow of the mutex’s owner — see Mutex::lock_guard for the rationale.
The BackRef invariant (pointee outlives holder) is the caller contract on
lock_guard(): the mutex outlives this guard (always true when the guard
is a local that drops before the owning struct).
Trait Implementations§
Source§impl Drop for MutexGuard
impl Drop for MutexGuard
Auto Trait Implementations§
impl !Send for MutexGuard
impl !Sync for MutexGuard
impl Freeze for MutexGuard
impl RefUnwindSafe for MutexGuard
impl Unpin for MutexGuard
impl UnsafeUnpin for MutexGuard
impl UnwindSafe for MutexGuard
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.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