Function async_stm::atomically

source ·
pub async fn atomically<F, T>(f: F) -> Twhere
    F: Fn() -> StmResult<T>,
Expand description

The primary verbs to interact with STM transactions. Create a new transaction and run f until it returns a successful result and can be committed without running into version conflicts.

Make sure f is free of any side effects, because it can be called repeatedly.