txn

Function txn 

Source
pub(crate) fn txn<F, T>(
    mu: &Mutex<Connection>,
    label: &'static str,
    f: F,
) -> Result<T>
where F: FnOnce(&Transaction<'_>) -> Result<T>,
Expand description

Lock + open txn + run closure + commit. label shapes the begin/commit error context. Closure errors abort the txn.