pub fn with_tx<T, E>(
conn: &mut Connection,
f: impl FnOnce(&mut Transaction<'_>) -> Result<T, E>,
) -> Result<T, E>
Expand description
Short-hand for constructing a transaction, providing it as an argument to the given function, then committing the transaction before returning.