Crate atomic_destroy

Source
Expand description

Atomically destroyable types.

§Examples

let value = AtomicDestroy::new(Box::new(5));
assert_eq!(**value.get().unwrap(), 5);
value.destroy();
// The Box's destructor is run here.
assert!(value.get().is_none());

Structs§

AtomicDestroy
An atomically destroyable value.
Value
A “locked” value of an AtomicDestroy. While one of these exists the value inside the AtomicDestroy is guaranteed not to be dropped.