#[non_exhaustive]pub enum Selector {
SingleUse(Box<TransactionOptions>),
Id(Bytes),
Begin(Box<TransactionOptions>),
}Expand description
If no fields are set, the default is a single use transaction with strong concurrency.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SingleUse(Box<TransactionOptions>)
Execute the read or SQL query in a temporary transaction. This is the most efficient way to execute a transaction that consists of a single SQL query.
Id(Bytes)
Execute the read or SQL query in a previously-started transaction.
Begin(Box<TransactionOptions>)
Begin a new transaction and execute this read or SQL query in it. The transaction ID of the new transaction is returned in ResultSetMetadata.transaction, which is a Transaction.
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn from_single_use(value: impl Into<Box<TransactionOptions>>) -> Self
pub fn from_single_use(value: impl Into<Box<TransactionOptions>>) -> Self
Initializes the enum to the SingleUse branch.
Sourcepub fn from_begin(value: impl Into<Box<TransactionOptions>>) -> Self
pub fn from_begin(value: impl Into<Box<TransactionOptions>>) -> Self
Initializes the enum to the Begin branch.
Trait Implementations§
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl !Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
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<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,
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>
Wrap the input message
T in a tonic::Request