pub enum SortDirection {
Ascending,
Descending,
}Expand description
Sort direction metadata.
Variants§
Implementations§
Source§impl SortDirection
impl SortDirection
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns a stable lowercase sort direction label.
Examples found in repository?
examples/basic_usage.rs (line 21)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let database = DatabaseName::new("app")?;
8 let schema = SchemaName::new("public")?;
9 let table = TableName::new("users")?;
10 let column = ColumnName::new("id")?;
11
12 let primary_key = PrimaryKey::new(table.clone(), column.clone());
13 let page = PageRequest::new(1, 50);
14 let isolation = TransactionIsolation::Serializable;
15
16 assert_eq!(database.as_str(), "app");
17 assert_eq!(schema.as_str(), "public");
18 assert_eq!(primary_key.table(), &table);
19 assert_eq!(primary_key.column(), &column);
20 assert_eq!(page.per_page(), 50);
21 assert_eq!(SortDirection::Ascending.as_str(), "ascending");
22 assert_eq!(isolation.as_str(), "serializable");
23
24 Ok(())
25}Trait Implementations§
Source§impl Clone for SortDirection
impl Clone for SortDirection
Source§fn clone(&self) -> SortDirection
fn clone(&self) -> SortDirection
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 SortDirection
impl Debug for SortDirection
Source§impl Default for SortDirection
impl Default for SortDirection
Source§fn default() -> SortDirection
fn default() -> SortDirection
Returns the “default value” for a type. Read more
Source§impl Hash for SortDirection
impl Hash for SortDirection
Source§impl Ord for SortDirection
impl Ord for SortDirection
Source§fn cmp(&self, other: &SortDirection) -> Ordering
fn cmp(&self, other: &SortDirection) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SortDirection
impl PartialEq for SortDirection
Source§fn eq(&self, other: &SortDirection) -> bool
fn eq(&self, other: &SortDirection) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SortDirection
impl PartialOrd for SortDirection
impl Copy for SortDirection
impl Eq for SortDirection
impl StructuralPartialEq for SortDirection
Auto Trait Implementations§
impl Freeze for SortDirection
impl RefUnwindSafe for SortDirection
impl Send for SortDirection
impl Sync for SortDirection
impl Unpin for SortDirection
impl UnsafeUnpin for SortDirection
impl UnwindSafe for SortDirection
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