pub struct TransactionConfig {
pub isolation: IsolationLevel,
pub access_mode: AccessMode,
pub timeout: Option<Duration>,
pub deferrable: bool,
}Expand description
Configuration for a transaction.
Fields§
§isolation: IsolationLevelIsolation level.
access_mode: AccessModeAccess mode.
timeout: Option<Duration>Timeout for the transaction.
deferrable: boolWhether to defer constraint checking.
Implementations§
Source§impl TransactionConfig
impl TransactionConfig
Sourcepub fn isolation(self, level: IsolationLevel) -> Self
pub fn isolation(self, level: IsolationLevel) -> Self
Set the isolation level.
Sourcepub fn access_mode(self, mode: AccessMode) -> Self
pub fn access_mode(self, mode: AccessMode) -> Self
Set the access mode.
Sourcepub fn deferrable(self) -> Self
pub fn deferrable(self) -> Self
Make the transaction deferrable.
Sourcepub fn to_begin_sql(&self) -> String
pub fn to_begin_sql(&self) -> String
Generate the BEGIN TRANSACTION SQL.
Trait Implementations§
Source§impl Clone for TransactionConfig
impl Clone for TransactionConfig
Source§impl Debug for TransactionConfig
impl Debug for TransactionConfig
Auto Trait Implementations§
impl Forget for TransactionConfig
impl Freeze for TransactionConfig
impl Move 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