The session tracks the state explicitly rather than inferring it from the
borrow of a guard: Fresh → Active → Finalizing → Done | Detached.
Fresh means no BEGIN has been sent yet (begin is lazy, per the
sql-transactions requirement “Lazy begin and block-owned commit/rollback”),
Finalizing covers an in-flight COMMIT/ROLLBACK, and Detached records
a connection that was discarded instead of returned to the pool (requirement
“Uncertain finalization detaches the connection”).
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.