Trait WithSharedInner

Source
pub trait WithSharedInner<T> {
    // Required methods
    fn with_inner<F, R>(&self, func: F) -> Option<R>
       where F: FnOnce(&mut T) -> R;
    fn try_with_inner<F, R>(&self, func: F) -> Option<R>
       where F: FnOnce(&mut T) -> R;
}

Required Methods§

Source

fn with_inner<F, R>(&self, func: F) -> Option<R>
where F: FnOnce(&mut T) -> R,

Waits for the lock to become available and then calls the closure

Source

fn try_with_inner<F, R>(&self, func: F) -> Option<R>
where F: FnOnce(&mut T) -> R,

Immediately locks the mutex and calls the closure

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.

Implementors§