[][src]Function tarantool_module::transaction::start_transaction

pub fn start_transaction<T, E, F>(f: F) -> Result<T, E> where
    F: FnOnce() -> Result<T, E>,
    E: From<TransactionError>, 

Begin a transaction in the current fiber.

A transaction is attached to caller fiber, therefore one fiber can have only one active transaction.

  • f - function will be invoked within transaction

Returns result of function f execution. Depending on the function result:

  • will commit - if function completes successfully
  • will rollback - if function completes with any error