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§fn clone(&self) -> TransactionConfig
fn clone(&self) -> TransactionConfig
Returns a duplicate of the value. Read more
1.0.0§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
Source§impl Default for TransactionConfig
impl Default for TransactionConfig
Source§fn default() -> TransactionConfig
fn default() -> TransactionConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TransactionConfig
impl RefUnwindSafe for TransactionConfig
impl Send for TransactionConfig
impl Sync for TransactionConfig
impl Unpin for TransactionConfig
impl UnwindSafe for TransactionConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)