#[non_exhaustive]pub struct Transaction {
pub id: Bytes,
pub read_timestamp: Option<Timestamp>,
pub precommit_token: Option<MultiplexedSessionPrecommitToken>,
pub cache_update: Option<CacheUpdate>,
/* private fields */
}Expand description
A transaction.
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.id: Bytesid may be used to identify the transaction in subsequent
Read,
ExecuteSql,
Commit, or
Rollback calls.
Single-use read-only transactions do not have IDs, because single-use transactions do not support multiple requests.
read_timestamp: Option<Timestamp>For snapshot read-only transactions, the read timestamp chosen for the transaction. Not returned by default: see TransactionOptions.ReadOnly.return_read_timestamp.
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example: "2014-10-02T15:01:23.045123456Z".
precommit_token: Option<MultiplexedSessionPrecommitToken>A precommit token is included in the response of a BeginTransaction request if the read-write transaction is on a multiplexed session and a mutation_key was specified in the BeginTransaction. The precommit token with the highest sequence number from this transaction attempt should be passed to the Commit request for this transaction.
cache_update: Option<CacheUpdate>Optional. A cache update expresses a set of changes the client should
incorporate into its location cache. The client should discard the changes
if they are older than the data it already has. This data can be obtained
in response to requests that included a RoutingHint field, but may also
be obtained by explicit location-fetching RPCs which may be added in the
future.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn set_read_timestamp<T>(self, v: T) -> Self
pub fn set_read_timestamp<T>(self, v: T) -> Self
Sets the value of read_timestamp.
Sourcepub fn set_or_clear_read_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_read_timestamp<T>(self, v: Option<T>) -> Self
Sets or clears the value of read_timestamp.
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_cache_update<T>(self, v: T) -> Selfwhere
T: Into<CacheUpdate>,
pub fn set_cache_update<T>(self, v: T) -> Selfwhere
T: Into<CacheUpdate>,
Sets the value of cache_update.
Sourcepub fn set_or_clear_cache_update<T>(self, v: Option<T>) -> Selfwhere
T: Into<CacheUpdate>,
pub fn set_or_clear_cache_update<T>(self, v: Option<T>) -> Selfwhere
T: Into<CacheUpdate>,
Sets or clears the value of cache_update.
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
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 Transaction
impl Debug for Transaction
Source§impl Default for Transaction
impl Default for Transaction
Source§fn default() -> Transaction
fn default() -> Transaction
Source§impl Message for Transaction
impl Message for Transaction
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl !Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
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