MutableHelper

Trait MutableHelper 

Source
pub trait MutableHelper<T> {
    // Required methods
    fn lock_mut<R>(&self, callback: impl FnOnce(MutGuard<'_, T>) -> R) -> R;
    fn lock_ref<R>(&self, callback: impl FnOnce(RefGuard<'_, T>) -> R) -> R;
}

Required Methods§

Source

fn lock_mut<R>(&self, callback: impl FnOnce(MutGuard<'_, T>) -> R) -> R

Source

fn lock_ref<R>(&self, callback: impl FnOnce(RefGuard<'_, T>) -> R) -> R

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> MutableHelper<T> for Mutex<T>

Source§

fn lock_mut<R>(&self, callback: impl FnOnce(MutGuard<'_, T>) -> R) -> R

Source§

fn lock_ref<R>(&self, callback: impl FnOnce(RefGuard<'_, T>) -> R) -> R

Implementors§