pub async fn atomically_or_err<F, T>(
    f: F
) -> Result<T, Box<dyn Error + Send + Sync>>where
    F: Fn() -> StmDynResult<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, or until it returns an 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.