Struct embassy_sync::mutex::MutexGuard
source · pub struct MutexGuard<'a, M, T>where
M: RawMutex,
T: ?Sized,{ /* private fields */ }
Expand description
Async mutex guard.
Owning an instance of this type indicates having successfully locked the mutex, and grants access to the contents.
Dropping it unlocks the mutex.
Implementations§
source§impl<'a, M, T> MutexGuard<'a, M, T>where
M: RawMutex,
T: ?Sized,
impl<'a, M, T> MutexGuard<'a, M, T>where
M: RawMutex,
T: ?Sized,
sourcepub fn map<U>(
this: Self,
fun: impl FnOnce(&mut T) -> &mut U,
) -> MappedMutexGuard<'a, M, U>
pub fn map<U>( this: Self, fun: impl FnOnce(&mut T) -> &mut U, ) -> MappedMutexGuard<'a, M, U>
Returns a locked view over a portion of the locked data.