pub async fn do_transaction<T, R>(
engine: &EngineProxy,
cb: T,
) -> Result<(), EditTransactionError>where
T: Fn(EditTransaction) -> R,
R: Future<Output = Result<EditTransaction, EditTransactionError>>,
Expand description
Perform a rewrite rule edit transaction, retrying as necessary if another edit transaction runs concurrently.
The given callback cb
should perform the needed edits to the state of the rewrite rules but
not attempt to commit()
the transaction. do_transaction
will internally attempt to commit
the transaction and trigger a retry if necessary.