use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Deserialize, Hash, PartialEq, Eq, Serialize)]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[cfg_attr(feature = "async-graphql", derive(async_graphql::Enum))]
#[non_exhaustive]
pub enum OrderDirection {
#[serde(rename = "asc")]
Ascending,
#[serde(rename = "desc")]
Descending,
}
impl std::fmt::Display for OrderDirection {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
fmt.write_str(match self {
Self::Ascending => "asc",
Self::Descending => "desc",
})
}
}