use crate::error::ConfigError;
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[non_exhaustive]
pub enum Ordering {
#[default]
Unordered,
PerKey,
}
impl Ordering {
pub const fn validate(self) -> Result<(), ConfigError> {
match self {
Self::Unordered => Ok(()),
Self::PerKey => Err(ConfigError::UnsupportedOrdering {
ordering: self,
available_in: "0.2",
}),
}
}
}