pub struct TransactionOptions {
pub timeout_ms: Option<u64>,
pub isolation: TransactionIsolation,
pub retry_on_conflict: bool,
pub max_retries: u32,
}Expand description
Options for transaction execution
Fields§
§timeout_ms: Option<u64>Timeout for the transaction in milliseconds (default: 30000)
isolation: TransactionIsolationIsolation level for the transaction
retry_on_conflict: boolWhether to retry on transient failures
max_retries: u32Maximum number of retries
Implementations§
Source§impl TransactionOptions
impl TransactionOptions
Sourcepub const fn timeout_ms(self, ms: u64) -> Self
pub const fn timeout_ms(self, ms: u64) -> Self
Set the timeout
Sourcepub const fn isolation(self, level: TransactionIsolation) -> Self
pub const fn isolation(self, level: TransactionIsolation) -> Self
Set the isolation level
Sourcepub const fn with_retries(self, max_retries: u32) -> Self
pub const fn with_retries(self, max_retries: u32) -> Self
Enable retry on conflict
If enabled, the transaction closure may re-run on transient database failures. Ensure the closure body is idempotent (or safely handles retry) when enabling this option.
Trait Implementations§
Source§impl Clone for TransactionOptions
impl Clone for TransactionOptions
Source§fn clone(&self) -> TransactionOptions
fn clone(&self) -> TransactionOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransactionOptions
impl Debug for TransactionOptions
Source§impl Default for TransactionOptions
impl Default for TransactionOptions
Source§fn default() -> TransactionOptions
fn default() -> TransactionOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TransactionOptions
impl RefUnwindSafe for TransactionOptions
impl Send for TransactionOptions
impl Sync for TransactionOptions
impl Unpin for TransactionOptions
impl UnsafeUnpin for TransactionOptions
impl UnwindSafe for TransactionOptions
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
Mutably borrows from an owned value. Read more