pub struct SqlTxSession { /* private fields */ }Expand description
One block-owned transaction on one datasource.
The session owns its pooled connection as sole owner through the
admission slot (a tokio::sync::Mutex around the TxIo backend: the
slot IS the one-statement-at-a-time admission, try_lock → Busy), the
discard guard is that same ownership armed from checkout — dropping the
session in any phase except Done/Detached detaches synchronously
(R0). rollback_only is the port’s atomic flag.
Constructed through open (checkout + admission hygiene
→ Clean) by the datasource manager; unit fixtures construct directly
over a scripted backend via with_io.
Implementations§
Source§impl SqlTxSession
impl SqlTxSession
Sourcepub async fn open_on_pool(
datasource: impl Into<Arc<str>>,
pool: &AnyPool,
block_abs: Instant,
acquire_deadline: Duration,
) -> Result<Self, TransactionError>
pub async fn open_on_pool( datasource: impl Into<Arc<str>>, pool: &AnyPool, block_abs: Instant, acquire_deadline: Duration, ) -> Result<Self, TransactionError>
Manager entry point over a real pool: open on the
default tokio clock.
The injectable-clock open stays crate-private for the
unit fixtures; this wrapper is the constructor the datasource manager
(sqltrans-exec step 9) and the PG integration suite
(crates/camel-test/tests/sql_transacted_test.rs) drive.
Trait Implementations§
Source§impl Drop for SqlTxSession
impl Drop for SqlTxSession
Source§impl TransactionSession for SqlTxSession
impl TransactionSession for SqlTxSession
Source§fn datasource(&self) -> &str
fn datasource(&self) -> &str
Source§fn state(&self) -> TransactionState
fn state(&self) -> TransactionState
Source§fn begin(&self) -> BeginFuture<'_>
fn begin(&self) -> BeginFuture<'_>
BEGIN. Read moreSource§fn set_rollback_only(&self)
fn set_rollback_only(&self)
Source§fn is_rollback_only(&self) -> bool
fn is_rollback_only(&self) -> bool
Source§fn commit(&self) -> FinalizeFuture<'_>
fn commit(&self) -> FinalizeFuture<'_>
Source§fn rollback(&self) -> FinalizeFuture<'_>
fn rollback(&self) -> FinalizeFuture<'_>
Auto Trait Implementations§
impl !Freeze for SqlTxSession
impl !RefUnwindSafe for SqlTxSession
impl !UnwindSafe for SqlTxSession
impl Forget for SqlTxSession
impl Move for SqlTxSession
impl Send for SqlTxSession
impl Sync for SqlTxSession
impl Unpin for SqlTxSession
impl UnsafeUnpin for SqlTxSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more