Function stm::unwrap_or_retry [] [src]

pub fn unwrap_or_retry<T>(option: Option<T>) -> StmResult<T>

Unwrap Option or call retry if it is None.

Example

use stm::*;

let x = atomically(|_tx|
    unwrap_or_retry(Some(42))
);
assert_eq!(x, 42);