Function atomically_or_err

Source
pub async fn atomically_or_err<T, E, F>(f: F) -> Result<T, E>
where F: Fn() -> StmResult<T, E>,
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, or until it returns an StmError::Abort in which case the contained error is returned.

Make sure f is free of any side effects, becuase it can be called repeatedly and also be aborted.