#[non_exhaustive]pub struct CommitRequest {
pub session: String,
pub mutations: Vec<Mutation>,
pub return_commit_stats: bool,
pub max_commit_delay: Option<Duration>,
pub request_options: Option<RequestOptions>,
pub precommit_token: Option<MultiplexedSessionPrecommitToken>,
pub routing_hint: Option<RoutingHint>,
pub transaction: Option<Transaction>,
/* private fields */
}Expand description
The request for Commit.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.session: StringRequired. The session in which the transaction to be committed is running.
mutations: Vec<Mutation>The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.
return_commit_stats: boolIf true, then statistics related to the transaction is included in
the CommitResponse.
Default value is false.
max_commit_delay: Option<Duration>Optional. The amount of latency this request is configured to incur in order to improve throughput. If this field isn’t set, Spanner assumes requests are relatively latency sensitive and automatically determines an appropriate delay time. You can specify a commit delay value between 0 and 500 ms.
request_options: Option<RequestOptions>Common options for this request.
precommit_token: Option<MultiplexedSessionPrecommitToken>Optional. If the read-write transaction was executed on a multiplexed
session, then you must include the precommit token with the highest
sequence number received in this transaction attempt. Failing to do so
results in a FailedPrecondition error.
routing_hint: Option<RoutingHint>Optional. Makes the Spanner requests location-aware if present.
It gives the server hints that can be used to route the request to an appropriate server, potentially significantly decreasing latency and improving throughput. To achieve improved performance, most fields must be filled in with accurate values.
transaction: Option<Transaction>Required. The transaction in which to commit.
Implementations§
Source§impl CommitRequest
impl CommitRequest
Sourcepub fn set_session<T: Into<String>>(self, v: T) -> Self
pub fn set_session<T: Into<String>>(self, v: T) -> Self
Sets the value of session.
Sourcepub fn set_mutations<T, V>(self, v: T) -> Self
pub fn set_mutations<T, V>(self, v: T) -> Self
Sets the value of mutations.
Sourcepub fn set_return_commit_stats<T: Into<bool>>(self, v: T) -> Self
pub fn set_return_commit_stats<T: Into<bool>>(self, v: T) -> Self
Sets the value of return_commit_stats.
Sourcepub fn set_max_commit_delay<T>(self, v: T) -> Self
pub fn set_max_commit_delay<T>(self, v: T) -> Self
Sets the value of max_commit_delay.
Sourcepub fn set_or_clear_max_commit_delay<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_commit_delay<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_commit_delay.
Sourcepub fn set_request_options<T>(self, v: T) -> Selfwhere
T: Into<RequestOptions>,
pub fn set_request_options<T>(self, v: T) -> Selfwhere
T: Into<RequestOptions>,
Sets the value of request_options.
Sourcepub fn set_or_clear_request_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<RequestOptions>,
pub fn set_or_clear_request_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<RequestOptions>,
Sets or clears the value of request_options.
Sourcepub fn set_precommit_token<T>(self, v: T) -> Selfwhere
T: Into<MultiplexedSessionPrecommitToken>,
pub fn set_precommit_token<T>(self, v: T) -> Selfwhere
T: Into<MultiplexedSessionPrecommitToken>,
Sets the value of precommit_token.
Sourcepub fn set_or_clear_precommit_token<T>(self, v: Option<T>) -> Selfwhere
T: Into<MultiplexedSessionPrecommitToken>,
pub fn set_or_clear_precommit_token<T>(self, v: Option<T>) -> Selfwhere
T: Into<MultiplexedSessionPrecommitToken>,
Sets or clears the value of precommit_token.
Sourcepub fn set_routing_hint<T>(self, v: T) -> Selfwhere
T: Into<RoutingHint>,
pub fn set_routing_hint<T>(self, v: T) -> Selfwhere
T: Into<RoutingHint>,
Sets the value of routing_hint.
Sourcepub fn set_or_clear_routing_hint<T>(self, v: Option<T>) -> Selfwhere
T: Into<RoutingHint>,
pub fn set_or_clear_routing_hint<T>(self, v: Option<T>) -> Selfwhere
T: Into<RoutingHint>,
Sets or clears the value of routing_hint.
Sourcepub fn set_transaction<T: Into<Option<Transaction>>>(self, v: T) -> Self
pub fn set_transaction<T: Into<Option<Transaction>>>(self, v: T) -> Self
Sets the value of transaction.
Note that all the setters affecting transaction are mutually
exclusive.
Sourcepub fn transaction_id(&self) -> Option<&Bytes>
pub fn transaction_id(&self) -> Option<&Bytes>
The value of transaction
if it holds a TransactionId, None if the field is not set or
holds a different branch.
Sourcepub fn set_transaction_id<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_transaction_id<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of transaction
to hold a TransactionId.
Note that all the setters affecting transaction are
mutually exclusive.
Sourcepub fn single_use_transaction(&self) -> Option<&Box<TransactionOptions>>
pub fn single_use_transaction(&self) -> Option<&Box<TransactionOptions>>
The value of transaction
if it holds a SingleUseTransaction, None if the field is not set or
holds a different branch.
Sourcepub fn set_single_use_transaction<T: Into<Box<TransactionOptions>>>(
self,
v: T,
) -> Self
pub fn set_single_use_transaction<T: Into<Box<TransactionOptions>>>( self, v: T, ) -> Self
Sets the value of transaction
to hold a SingleUseTransaction.
Note that all the setters affecting transaction are
mutually exclusive.
Trait Implementations§
Source§impl Clone for CommitRequest
impl Clone for CommitRequest
Source§fn clone(&self) -> CommitRequest
fn clone(&self) -> CommitRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommitRequest
impl Debug for CommitRequest
Source§impl Default for CommitRequest
impl Default for CommitRequest
Source§fn default() -> CommitRequest
fn default() -> CommitRequest
Source§impl Message for CommitRequest
impl Message for CommitRequest
Source§impl PartialEq for CommitRequest
impl PartialEq for CommitRequest
Source§fn eq(&self, other: &CommitRequest) -> bool
fn eq(&self, other: &CommitRequest) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommitRequest
Auto Trait Implementations§
impl !Freeze for CommitRequest
impl RefUnwindSafe for CommitRequest
impl Send for CommitRequest
impl Sync for CommitRequest
impl Unpin for CommitRequest
impl UnsafeUnpin for CommitRequest
impl UnwindSafe for CommitRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
T in a tonic::Request