pub fn lock_mutex<T>(mutex: &Mutex<T>) -> Option<MutexGuard<'_, T>>
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