Trait monster::incubation::with_lock::WithLock [] [src]

pub trait WithLock<T> {
    fn with_lock<F: FnOnce(&mut T) -> R, R>(&self, f: F) -> R;
}

Required Methods

Conveniently access mutexes.

Example

use std::sync::Mutex;
use monster::incubation::WithLock;

let n = Mutex::new(123);

n.with_lock(|n| {
    *n += 654
});

Implementors