Type Definition rental::RentMutex
[−]
[src]
type RentMutex<'rental, T: 'rental, B: 'rental> = RentRef<'rental, MutexGuard<'rental, T>, B>;
A predefined type that rents references from a MutexGuard<T>
.
Examples
let mutex = std::sync::Mutex::new(4); let guard = mutex.lock().unwrap(); let rent = rental::RentMutex::new(guard, |g| &*g); assert_eq!(*rent, 4);