#[cfg_attr(doc, doc = "Which way one ordering term runs.")]
#[cfg_attr(doc, doc = "")]
#[cfg_attr(
doc,
doc = "A closed, framework-owned vocabulary: SQL has two directions and a backend that grew a"
)]
#[cfg_attr(
doc,
doc = "third would be growing a different clause. So it is a unit enum rather than a seam — the"
)]
#[cfg_attr(
doc,
doc = "rule [`crate::Id`] and the comparison kinds already follow, where an OPEN surface is one a"
)]
#[cfg_attr(doc, doc = "downstream crate extends and this is not one.")]
#[cfg_attr(doc, doc = "")]
#[cfg_attr(doc, doc = "# It carries no `Default`, and the absence is the design")]
#[cfg_attr(doc, doc = "")]
#[cfg_attr(
doc,
doc = "A generated `*OrderBy` names one column and one direction as ONE value, so `{ title }` is"
)]
#[cfg_attr(
doc,
doc = "unspellable on the wire and there is no entry for a default to complete. A `Default` here"
)]
#[cfg_attr(
doc,
doc = "would exist only to be reached by a path that cannot arise, and the day one did arise it"
)]
#[cfg_attr(
doc,
doc = "would answer silently — which is the failure the pairing was chosen to prevent. polarsync's"
)]
#[cfg_attr(
doc,
doc = "ordering pairs two parallel lists by index and fills the short one with"
)]
#[cfg_attr(
doc,
doc = "`unwrap_or_default()`, so a length mismatch there is a plausible answer rather than an error."
)]
#[cfg_attr(doc, doc = "")]
#[cfg_attr(doc, doc = "# The wire spelling is `ASC` / `DESC`")]
#[cfg_attr(doc, doc = "")]
#[cfg_attr(
doc,
doc = "async-graphql renames enum values to `SCREAMING_SNAKE_CASE`, which is what GraphQL's own"
)]
#[cfg_attr(
doc,
doc = "convention asks for, so the Rust `Asc` reaches a client as `ASC`. The TYPE name is spelled"
)]
#[cfg_attr(
doc,
doc = "explicitly for the reason [`Score`](crate::Score)'s scalar name is: a wire name is a schema"
)]
#[cfg_attr(doc, doc = "commitment and a Rust rename is not a schema change.")]
#[cfg_attr(doc, doc = "")]
#[cfg_attr(
doc,
doc = "Every line of this is behind `cfg_attr(doc, …)` and NONE of it is published — see the"
)]
#[cfg_attr(
doc,
doc = "module note for the derive that would otherwise publish it, and for why the guard holds"
)]
#[cfg_attr(doc, doc = "whichever way a `cfg_attr` is expanded.")]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "async-graphql", derive(async_graphql::Enum))]
#[cfg_attr(feature = "async-graphql", graphql(name = "OrderDirection"))]
pub enum OrderDirection {
#[cfg_attr(doc, doc = "Smallest first — `ORDER BY <column> ASC`.")]
Asc,
#[cfg_attr(doc, doc = "Largest first — `ORDER BY <column> DESC`.")]
Desc,
}
impl OrderDirection {
#[inline]
#[must_use]
pub const fn is_descending(self) -> bool {
matches!(self, Self::Desc)
}
}
#[cfg(test)]
mod tests;