Struct mungos::options::SessionOptions
source · #[non_exhaustive]pub struct SessionOptions {
pub default_transaction_options: Option<TransactionOptions>,
pub causal_consistency: Option<bool>,
pub snapshot: Option<bool>,
}
Expand description
Contains the options that can be used to create a new
ClientSession
.
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.default_transaction_options: Option<TransactionOptions>
The default options to use for transactions started on this session.
If these options are not specified, they will be inherited from the
Client
associated with this session. They will not
be inherited from the options specified
on the Database
or Collection
associated with the operations within the transaction.
causal_consistency: Option<bool>
If true, all operations performed in the context of this session will be causally consistent.
Defaults to true if SessionOptions::snapshot
is unspecified.
snapshot: Option<bool>
If true, all read operations performed using this client session will share the same snapshot. Defaults to false.
Implementations§
source§impl SessionOptions
impl SessionOptions
sourcepub fn builder() -> SessionOptionsBuilder<((), (), ())>
pub fn builder() -> SessionOptionsBuilder<((), (), ())>
Create a builder for building SessionOptions
.
On the builder, call .default_transaction_options(...)
(optional), .causal_consistency(...)
(optional), .snapshot(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of SessionOptions
.
Trait Implementations§
source§impl Clone for SessionOptions
impl Clone for SessionOptions
source§fn clone(&self) -> SessionOptions
fn clone(&self) -> SessionOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more