pub trait StorageOperationContextOps:
Send
+ Sync
+ Debug {
// Required methods
fn bind_auto_commit_context(&self) -> Result<Self, StorageError>
where Self: Sized;
fn bind_operation_context(&self, context: StorageOperationContext) -> Self
where Self: Sized;
fn operation_context(&self) -> Option<Arc<StorageOperationContext>>;
// Provided methods
fn bind_read_operation_context(&self) -> Result<Self, StorageError>
where Self: Sized { ... }
fn finalize_operation(&self, _committed: bool) -> Result<(), StorageError> { ... }
}Expand description
Creates an immutable storage handle bound to a single operation context.
Required Methods§
fn bind_auto_commit_context(&self) -> Result<Self, StorageError>where
Self: Sized,
fn bind_operation_context(&self, context: StorageOperationContext) -> Selfwhere
Self: Sized,
fn operation_context(&self) -> Option<Arc<StorageOperationContext>>
Provided Methods§
Sourcefn bind_read_operation_context(&self) -> Result<Self, StorageError>where
Self: Sized,
fn bind_read_operation_context(&self) -> Result<Self, StorageError>where
Self: Sized,
Bind a read-only statement context with a fixed snapshot timestamp.
Read statements get a consistent statement-level snapshot: every
storage access observes the same read_timestamp, and per-table MVCC
snapshots are lazily registered on first table access so GC keeps the
versions the statement may still read. The snapshot is unregistered by
finalize_operation (or on Drop as a
backstop). The bound (space, snapshot_ts) pair is also the
serialization boundary for distributed reads.
The default implementation returns not_supported; engines without a
native read context fall back to the unbound handle.
Sourcefn finalize_operation(&self, _committed: bool) -> Result<(), StorageError>
fn finalize_operation(&self, _committed: bool) -> Result<(), StorageError>
Finalize an operation-owned auto-commit timestamp.
Explicit transaction contexts are finalized by TransactionManager
and therefore treat this as a no-op.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".