Type Alias Shared

Source
pub type Shared<T> = Arc<Mutex<T>>;

Aliased Type§

pub struct Shared<T> { /* private fields */ }

Trait Implementations§

Source§

impl<T> WithSharedInner<T> for Shared<T>

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