Enum mongodb::options::SelectionCriteria
source · [−]#[non_exhaustive]
pub enum SelectionCriteria {
ReadPreference(ReadPreference),
Predicate(Predicate),
}
Expand description
Describes which servers are suitable for a given operation.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ReadPreference(ReadPreference)
A read preference that describes the suitable servers based on the server type, max staleness, and server tags.
See the documentation here for more details.
Predicate(Predicate)
A predicate used to filter servers that are considered suitable. A server
will be
considered suitable by a predicate
if predicate(server)
returns true.
Trait Implementations
sourceimpl Clone for SelectionCriteria
impl Clone for SelectionCriteria
sourcefn clone(&self) -> SelectionCriteria
fn clone(&self) -> SelectionCriteria
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 SelectionCriteria
impl Debug for SelectionCriteria
sourceimpl<'de> Deserialize<'de> for SelectionCriteria
impl<'de> Deserialize<'de> for SelectionCriteria
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::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) -> Self
fn from(read_pref: ReadPreference) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for SelectionCriteria
impl Send for SelectionCriteria
impl Sync for SelectionCriteria
impl Unpin for SelectionCriteria
impl !UnwindSafe for SelectionCriteria
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more