pub struct TxOpts { /* private fields */ }
Expand description
Transaction options.
Example:
let tx_opts = TxOpts::default()
.with_consistent_snapshot(true)
.with_isolation_level(IsolationLevel::RepeatableRead);
Implementations§
Source§impl TxOpts
impl TxOpts
Sourcepub fn with_consistent_snapshot(&mut self, value: bool) -> &mut Self
pub fn with_consistent_snapshot(&mut self, value: bool) -> &mut Self
Sourcepub fn with_isolation_level<T>(&mut self, value: T) -> &mut Self
pub fn with_isolation_level<T>(&mut self, value: T) -> &mut Self
Sourcepub fn with_readonly<T>(&mut self, value: T) -> &mut Self
pub fn with_readonly<T>(&mut self, value: T) -> &mut Self
See TxOpts::readonly
.
Sourcepub fn consistent_snapshot(&self) -> bool
pub fn consistent_snapshot(&self) -> bool
If true, then START TRANSACTION WITH CONSISTENT SNAPSHOT
will be performed.
Defaults to false
.
Sourcepub fn isolation_level(&self) -> Option<IsolationLevel>
pub fn isolation_level(&self) -> Option<IsolationLevel>
If not None
, then SET TRANSACTION ISOLATION LEVEL ..
will be performed.
Defaults to None
.
Trait Implementations§
impl Eq for TxOpts
impl StructuralPartialEq for TxOpts
Auto Trait Implementations§
impl Freeze for TxOpts
impl RefUnwindSafe for TxOpts
impl Send for TxOpts
impl Sync for TxOpts
impl Unpin for TxOpts
impl UnwindSafe for TxOpts
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.