Enum mongodb::options::ReadPreference [−][src]
pub enum ReadPreference { Primary, Secondary { options: ReadPreferenceOptions, }, PrimaryPreferred { options: ReadPreferenceOptions, }, SecondaryPreferred { options: ReadPreferenceOptions, }, Nearest { options: ReadPreferenceOptions, }, }
Expand description
Specifies how the driver should route a read operation to members of a replica set.
If applicable, tag_sets
can be used to target specific nodes in a replica set, and
max_staleness
specifies the maximum lag behind the primary that a secondary can be to remain
eligible for the operation. The max staleness value maps to the maxStalenessSeconds
MongoDB
option and will be sent to the server as an integer number of seconds.
See the MongoDB docs for more details.
Variants
Only route this operation to the primary.
Only route this operation to a secondary.
Show fields
Fields of Secondary
options: ReadPreferenceOptions
Route this operation to the primary if it’s available, but fall back to the secondaries if not.
Show fields
Fields of PrimaryPreferred
options: ReadPreferenceOptions
Route this operation to a secondary if one is available, but fall back to the primary if not.
Show fields
Fields of SecondaryPreferred
options: ReadPreferenceOptions
Route this operation to the node with the least network latency regardless of whether it’s the primary or a secondary.
Show fields
Fields of Nearest
options: ReadPreferenceOptions
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ReadPreference
impl Send for ReadPreference
impl Sync for ReadPreference
impl Unpin for ReadPreference
impl UnwindSafe for ReadPreference
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V