#[non_exhaustive]pub struct TransactionOptions {
pub isolation_level: Option<IsolationLevel>,
pub read_only: Option<bool>,
pub deferrable: Option<bool>,
}Expand description
Options for beginning a transaction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.isolation_level: Option<IsolationLevel>Desired isolation level.
read_only: Option<bool>true for read-only, false for read-write, None to omit.
deferrable: Option<bool>true for deferrable (only valid with SERIALIZABLE and READ ONLY).
Implementations§
Source§impl TransactionOptions
impl TransactionOptions
Sourcepub fn isolation_level(self, level: IsolationLevel) -> Self
pub fn isolation_level(self, level: IsolationLevel) -> Self
Set the isolation level.
Sourcepub fn deferrable(self, deferrable: bool) -> Self
pub fn deferrable(self, deferrable: bool) -> Self
Set deferrable mode.
Sourcepub fn to_begin_sql(&self) -> String
pub fn to_begin_sql(&self) -> String
Build the BEGIN ... SQL statement from these options.
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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