Struct atomic_box::AtomicBox
[−]
[src]
pub struct AtomicBox<T> { /* fields omitted */ }A struct which allows multiple threads to safely update and read from a shared non-nullable pointer to heap data
Methods
impl<T> AtomicBox<T>[src]
fn new(data: T) -> AtomicBox<T>
Create a new atomic box from data
fn load(&self) -> Arc<T>
Get an Arc<T> pointing to the value currently stored in the box
fn store(&self, data: T)
Update the value stored in the box to point to data, the previous data will be reclaimed
once the last reader has dropped their reference.
fn swap(&self, data: T) -> Box<Arc<T>>
Swap the current value with data, returning a boxed Arc<T> pointing to the old value
Trait Implementations
impl<T> Drop for AtomicBox<T>[src]
impl<T> Debug for AtomicBox<T> where
T: Debug, [src]
T: Debug,