Struct concurrent::sync::Stm
[−]
[src]
pub struct Stm<T> { /* fields omitted */ }
A software transactional memory container.
Methods
impl<T> Stm<T>
[src]
fn new(data: Option<Box<T>>) -> Stm<T>
Create a new STM container.
fn update<F>(&self, f: F) where
F: Fn(Option<Guard<T>>) -> Option<Box<T>>,
T: 'static,
F: Fn(Option<Guard<T>>) -> Option<Box<T>>,
T: 'static,
Update the data.
This applies closure f
to the data of self
. If the data isn't updated in the meantime,
the change will applied. Otherwise, the closure is reevaluated.
fn load(&self) -> Option<Guard<T>>
Read the container.