lock_mutex

Function lock_mutex 

Source
pub fn lock_mutex<T>(mutex: &Mutex<T>) -> Option<MutexGuard<'_, T>>
Expand description

Helper function to lock a Mutex and access its value Returns None if the mutex is poisoned Note: This returns a guard, not a reference, so it cannot be used in keypaths directly