# Type Alias rustc_data_structures::sync::MappedLockGuard

source ·

    pub type MappedLockGuard<'a, T> = MappedMutexGuard<'a, RawMutex, T>;

Expand description

An RAII mutex guard returned by `MutexGuard::map`, which can point to a subfield of the protected data.

The main difference between `MappedMutexGuard` and `MutexGuard` is that the former doesn’t support temporarily unlocking and re-locking, since that could introduce soundness issues if the locked object is modified by another thread.

## Aliased Type§

    struct MappedLockGuard<'a, T> {
        raw: &'a RawMutex,
        data: *mut T,
        marker: PhantomData<&'a mut T>,
    }

## Fields§

§`raw: &'a RawMutex`§`data: *mut T`§`marker: PhantomData<&'a mut T>`

## Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain `repr(...)` attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 16 bytes