Struct mongodb::options::TransactionOptions
source · #[non_exhaustive]pub struct TransactionOptions {
pub read_concern: Option<ReadConcern>,
pub write_concern: Option<WriteConcern>,
pub selection_criteria: Option<SelectionCriteria>,
pub max_commit_time: Option<Duration>,
}Expand description
Contains the options that can be used for a transaction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.read_concern: Option<ReadConcern>The read concern to use for the transaction.
write_concern: Option<WriteConcern>The write concern to use when committing or aborting a transaction.
selection_criteria: Option<SelectionCriteria>The selection criteria to use for all read operations in a transaction.
max_commit_time: Option<Duration>The maximum amount of time to allow a single commitTransaction to run.
Implementations§
source§impl TransactionOptions
impl TransactionOptions
sourcepub fn builder() -> TransactionOptionsBuilder<((), (), (), ())>
pub fn builder() -> TransactionOptionsBuilder<((), (), (), ())>
Create a builder for building TransactionOptions.
On the builder, call .read_concern(...)(optional), .write_concern(...)(optional), .selection_criteria(...)(optional), .max_commit_time(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TransactionOptions.
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<'de> Deserialize<'de> for TransactionOptions
impl<'de> Deserialize<'de> for TransactionOptions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more