Struct mongodb::options::ReadPreferenceOptions [−][src]
#[non_exhaustive]pub struct ReadPreferenceOptions { pub tag_sets: Option<Vec<TagSet>>, pub max_staleness: Option<Duration>, pub hedge: Option<HedgedReadOptions>, }
Expand description
Specifies read preference options for non-primary read preferences.
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.tag_sets: Option<Vec<TagSet>>
Specifies which replica set members should be considered for operations. Each tag set will be checked in order until one or more servers is found with each tag in the set.
max_staleness: Option<Duration>
Specifies the maximum amount of lag behind the primary that a secondary can be to be
considered for the given operation. Any secondaries lagging behind more than
max_staleness
will not be considered for the operation.
max_staleness
must be at least 90 seconds. If a max_staleness
less than 90 seconds is
specified for an operation, the operation will return an error.
hedge: Option<HedgedReadOptions>
Specifies hedging behavior for reads. These options only apply to sharded clusters on servers that are at least version 4.4. Note that hedged reads are automatically enabled for read preference mode “nearest”.
See the MongoDB docs for more details.
Implementations
impl ReadPreferenceOptions
[src]
impl ReadPreferenceOptions
[src]pub fn builder() -> ReadPreferenceOptionsBuilder<((), (), ())>
[src]
pub fn builder() -> ReadPreferenceOptionsBuilder<((), (), ())>
[src]Create a builder for building ReadPreferenceOptions
.
On the builder, call .tag_sets(...)
(optional), .max_staleness(...)
(optional), .hedge(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of ReadPreferenceOptions
.
Trait Implementations
impl Clone for ReadPreferenceOptions
[src]
impl Clone for ReadPreferenceOptions
[src]fn clone(&self) -> ReadPreferenceOptions
[src]
fn clone(&self) -> ReadPreferenceOptions
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ReadPreferenceOptions
[src]
impl Debug for ReadPreferenceOptions
[src]impl Default for ReadPreferenceOptions
[src]
impl Default for ReadPreferenceOptions
[src]fn default() -> ReadPreferenceOptions
[src]
fn default() -> ReadPreferenceOptions
[src]Returns the “default value” for a type. Read more
impl<'de> Deserialize<'de> for ReadPreferenceOptions
[src]
impl<'de> Deserialize<'de> for ReadPreferenceOptions
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl PartialEq<ReadPreferenceOptions> for ReadPreferenceOptions
[src]
impl PartialEq<ReadPreferenceOptions> for ReadPreferenceOptions
[src]fn eq(&self, other: &ReadPreferenceOptions) -> bool
[src]
fn eq(&self, other: &ReadPreferenceOptions) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ReadPreferenceOptions) -> bool
[src]
fn ne(&self, other: &ReadPreferenceOptions) -> bool
[src]This method tests for !=
.
impl StructuralPartialEq for ReadPreferenceOptions
[src]
Auto Trait Implementations
impl RefUnwindSafe for ReadPreferenceOptions
impl Send for ReadPreferenceOptions
impl Sync for ReadPreferenceOptions
impl Unpin for ReadPreferenceOptions
impl UnwindSafe for ReadPreferenceOptions
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,