pub struct TransactionConfig {
pub timeout_ms: Option<u64>,
pub warn_after_ms: Option<u64>,
}Expand description
Configuration for transaction behavior
Fields§
§timeout_ms: Option<u64>Maximum duration before transaction auto-rollback (None = no timeout)
warn_after_ms: Option<u64>Emit warning if transaction exceeds this duration (None = no warning)
Implementations§
Source§impl TransactionConfig
impl TransactionConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new transaction configuration with safe defaults
- timeout_ms: 30 seconds
- warn_after_ms: 10 seconds
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set the transaction timeout in milliseconds
Sourcepub fn with_warning(self, warn_after_ms: u64) -> Self
pub fn with_warning(self, warn_after_ms: u64) -> Self
Set the warning threshold in milliseconds
Sourcepub fn with_timeout_and_warning(timeout_ms: u64, warn_after_ms: u64) -> Self
pub fn with_timeout_and_warning(timeout_ms: u64, warn_after_ms: u64) -> Self
Create a configuration with both timeout and warning
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Trait Implementations§
Source§impl Clone for TransactionConfig
impl Clone for TransactionConfig
Source§fn clone(&self) -> TransactionConfig
fn clone(&self) -> TransactionConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 TransactionConfig
impl Debug for TransactionConfig
Auto Trait Implementations§
impl Freeze for TransactionConfig
impl RefUnwindSafe for TransactionConfig
impl Send for TransactionConfig
impl Sync for TransactionConfig
impl Unpin for TransactionConfig
impl UnsafeUnpin for TransactionConfig
impl UnwindSafe for TransactionConfig
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