pub struct TransactionOptions { /* private fields */ }
Expand description
Options for configuring a transaction.
TransactionOptions
has a builder-style API.
Implementations§
Source§impl TransactionOptions
impl TransactionOptions
Sourcepub fn new_optimistic() -> TransactionOptions
pub fn new_optimistic() -> TransactionOptions
Default options for an optimistic transaction.
Sourcepub fn new_pessimistic() -> TransactionOptions
pub fn new_pessimistic() -> TransactionOptions
Default options for a pessimistic transaction.
Sourcepub fn use_async_commit(self) -> TransactionOptions
pub fn use_async_commit(self) -> TransactionOptions
Try to use async commit.
Sourcepub fn try_one_pc(self) -> TransactionOptions
pub fn try_one_pc(self) -> TransactionOptions
Try to use 1pc.
Sourcepub fn read_only(self) -> TransactionOptions
pub fn read_only(self) -> TransactionOptions
Make the transaction read only.
Sourcepub fn no_resolve_locks(self) -> TransactionOptions
pub fn no_resolve_locks(self) -> TransactionOptions
Don’t automatically resolve locks and retry if keys are locked.
Sourcepub fn no_resolve_regions(self) -> TransactionOptions
pub fn no_resolve_regions(self) -> TransactionOptions
Don’t automatically resolve regions with PD if we have outdated region information.
Sourcepub fn retry_options(self, options: RetryOptions) -> TransactionOptions
pub fn retry_options(self, options: RetryOptions) -> TransactionOptions
Set RetryOptions.
Sourcepub fn drop_check(self, level: CheckLevel) -> TransactionOptions
pub fn drop_check(self, level: CheckLevel) -> TransactionOptions
Set the behavior when dropping a transaction without an attempt to commit or rollback it.
pub fn heartbeat_option( self, heartbeat_option: HeartbeatOption, ) -> TransactionOptions
pub fn is_pessimistic(&self) -> bool
Trait Implementations§
Source§impl Clone for TransactionOptions
impl Clone for TransactionOptions
Source§fn clone(&self) -> TransactionOptions
fn clone(&self) -> TransactionOptions
Returns a copy 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 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
Source§impl PartialEq for TransactionOptions
impl PartialEq for TransactionOptions
impl StructuralPartialEq for TransactionOptions
Auto Trait Implementations§
impl Freeze for TransactionOptions
impl RefUnwindSafe for TransactionOptions
impl Send for TransactionOptions
impl Sync for TransactionOptions
impl Unpin for TransactionOptions
impl UnwindSafe for TransactionOptions
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request