pub struct OrderByItem {
pub field: String,
pub direction: Direction,
}Expand description
A single sort key for the order_by argument of crate::store::Store::list.
field must be a name registered in schema.yaml; it is validated by
validate_order_by before any SQL is generated. direction controls
whether the sort is ascending or descending.
§Example JSON
{"field": "priority", "direction": "asc"}Fields§
§field: StringSchema-registered field name to sort by.
Must exist in schema.yaml; unknown names are rejected by
validate_order_by with MiniAppError::Validation.
direction: DirectionSort direction: "asc" (ascending) or "desc" (descending).
Trait Implementations§
Source§impl Clone for OrderByItem
impl Clone for OrderByItem
Source§fn clone(&self) -> OrderByItem
fn clone(&self) -> OrderByItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OrderByItem
impl Debug for OrderByItem
Source§impl<'de> Deserialize<'de> for OrderByItem
impl<'de> Deserialize<'de> for OrderByItem
Source§fn 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
Source§impl JsonSchema for OrderByItem
impl JsonSchema for OrderByItem
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for OrderByItem
impl RefUnwindSafe for OrderByItem
impl Send for OrderByItem
impl Sync for OrderByItem
impl Unpin for OrderByItem
impl UnsafeUnpin for OrderByItem
impl UnwindSafe for OrderByItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more