Skip to main content

atomically

Function atomically 

Source
pub fn atomically<T>(
    change: impl FnOnce() -> Result<T, String>,
) -> Result<T, String>
Expand description

Runs change against the document and keeps what it did only if it succeeds: on an Err the document is exactly as it was before, op log included.