[][src]Enum mongodb::options::ReadPreference

pub enum ReadPreference {
    Primary,
    Secondary {
        options: ReadPreferenceOptions,
    },
    PrimaryPreferred {
        options: ReadPreferenceOptions,
    },
    SecondaryPreferred {
        options: ReadPreferenceOptions,
    },
    Nearest {
        options: ReadPreferenceOptions,
    },
}

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

Only route this operation to a secondary.

Fields of Secondary

options: ReadPreferenceOptions
PrimaryPreferred

Route this operation to the primary if it's available, but fall back to the secondaries if not.

Fields of PrimaryPreferred

options: ReadPreferenceOptions
SecondaryPreferred

Route this operation to a secondary if one is available, but fall back to the primary if not.

Fields of SecondaryPreferred

options: ReadPreferenceOptions
Nearest

Route this operation to the node with the least network latency regardless of whether it's the primary or a secondary.

Fields of Nearest

options: ReadPreferenceOptions

Trait Implementations

impl Clone for ReadPreference[src]

impl Debug for ReadPreference[src]

impl From<ReadPreference> for SelectionCriteria[src]

impl PartialEq<ReadPreference> for ReadPreference[src]

impl StructuralPartialEq for ReadPreference[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,