Struct tikv_client::TransactionOptions
source · 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
source§fn eq(&self, other: &TransactionOptions) -> bool
fn eq(&self, other: &TransactionOptions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TransactionOptions
Auto Trait Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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