Enum mungos::options::ReadPreference
source · [−]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
Primary
Only route this operation to the primary.
Secondary
Fields
options: ReadPreferenceOptions
Only route this operation to a secondary.
PrimaryPreferred
Fields
options: ReadPreferenceOptions
Route this operation to the primary if it’s available, but fall back to the secondaries if not.
SecondaryPreferred
Fields
options: ReadPreferenceOptions
Route this operation to a secondary if one is available, but fall back to the primary if not.
Nearest
Fields
options: ReadPreferenceOptions
Route this operation to the node with the least network latency regardless of whether it’s the primary or a secondary.
Trait Implementations
sourceimpl Clone for ReadPreference
impl Clone for ReadPreference
sourcefn clone(&self) -> ReadPreference
fn clone(&self) -> ReadPreference
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ReadPreference
impl Debug for ReadPreference
sourceimpl<'de> Deserialize<'de> for ReadPreference
impl<'de> Deserialize<'de> for ReadPreference
sourcefn deserialize<D>(
deserializer: D
) -> Result<ReadPreference, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<ReadPreference, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<ReadPreference> for SelectionCriteria
impl From<ReadPreference> for SelectionCriteria
sourcefn from(read_pref: ReadPreference) -> SelectionCriteria
fn from(read_pref: ReadPreference) -> SelectionCriteria
Converts to this type from the input type.
sourceimpl PartialEq<ReadPreference> for ReadPreference
impl PartialEq<ReadPreference> for ReadPreference
sourcefn eq(&self, other: &ReadPreference) -> bool
fn eq(&self, other: &ReadPreference) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ReadPreference) -> bool
fn ne(&self, other: &ReadPreference) -> bool
This method tests for !=
.
sourceimpl Serialize for ReadPreference
impl Serialize for ReadPreference
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ReadPreference
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more