pub fn capture() -> Result<Captured<TransactionContext>, TransactionError>Expand description
Capture the calling thread’s current transaction.
Returns Captured::Absent when the thread carries no transaction, which is
the ordinary case, and Captured::Present holding an owned duplicate
otherwise, so the value does not depend on the caller keeping its own handle
open.
§Errors
Returns TransactionFailure::Unsupported if the entry points are
unavailable, and TransactionFailure::Duplicate if the handle could not be
duplicated. Neither is reported as “no transaction”: a platform that cannot
answer is not the same as an answer.