pub struct MutexGuard<'handle, T>where
T: Debug,{ /* private fields */ }Expand description
A guard which allows the modification of a value guarded by a Mutex. It is returned in
Mutex::lock(), Mutex::try_lock() and Mutex::timed_lock().
§Example
extern crate iceoryx2_loggers;
use iceoryx2_bb_posix::mutex::*;
let handle = MutexHandle::<i32>::new();
let mutex = MutexBuilder::new().create(123, &handle)
.expect("failed to create mutex");
{
let mut guard = mutex.lock().expect("failed to lock");
println!("Old value is {}", *guard);
*guard = 456;
}Trait Implementations§
Source§impl<'handle, T> Debug for MutexGuard<'handle, T>where
T: Debug,
impl<'handle, T> Debug for MutexGuard<'handle, T>where
T: Debug,
Source§impl<T> Deref for MutexGuard<'_, T>where
T: Debug,
impl<T> Deref for MutexGuard<'_, T>where
T: Debug,
Source§impl<T> DerefMut for MutexGuard<'_, T>where
T: Debug,
impl<T> DerefMut for MutexGuard<'_, T>where
T: Debug,
Source§impl<T> Drop for MutexGuard<'_, T>where
T: Debug,
impl<T> Drop for MutexGuard<'_, T>where
T: Debug,
Source§impl<T> PartialEq for MutexGuard<'_, T>where
T: Debug,
impl<T> PartialEq for MutexGuard<'_, T>where
T: Debug,
impl<T> Eq for MutexGuard<'_, T>where
T: Debug,
Auto Trait Implementations§
impl<'handle, T> Freeze for MutexGuard<'handle, T>
impl<'handle, T> !RefUnwindSafe for MutexGuard<'handle, T>
impl<'handle, T> Send for MutexGuard<'handle, T>
impl<'handle, T> Sync for MutexGuard<'handle, T>
impl<'handle, T> Unpin for MutexGuard<'handle, T>
impl<'handle, T> !UnwindSafe for MutexGuard<'handle, T>
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