Enum mungos::options::SelectionCriteria
source · #[non_exhaustive]
pub enum SelectionCriteria {
ReadPreference(ReadPreference),
Predicate(Arc<dyn Fn(&ServerInfo<'_>) -> bool + Sync + Send + 'static>),
}
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(Arc<dyn Fn(&ServerInfo<'_>) -> bool + Sync + Send + 'static>)
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§
source§impl Clone for SelectionCriteria
impl Clone for SelectionCriteria
source§fn clone(&self) -> SelectionCriteria
fn clone(&self) -> SelectionCriteria
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SelectionCriteria
impl Debug for SelectionCriteria
source§impl<'de> Deserialize<'de> for SelectionCriteria
impl<'de> Deserialize<'de> for SelectionCriteria
source§fn deserialize<D>(
deserializer: D
) -> Result<SelectionCriteria, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<SelectionCriteria, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<ReadPreference> for SelectionCriteria
impl From<ReadPreference> for SelectionCriteria
source§fn from(read_pref: ReadPreference) -> SelectionCriteria
fn from(read_pref: ReadPreference) -> SelectionCriteria
Converts to this type from the input type.
source§impl PartialEq<SelectionCriteria> for SelectionCriteria
impl PartialEq<SelectionCriteria> for SelectionCriteria
source§fn eq(&self, other: &SelectionCriteria) -> bool
fn eq(&self, other: &SelectionCriteria) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.