pub struct SortingParams { /* private fields */ }Implementations§
Source§impl SortingParams
impl SortingParams
pub fn new() -> SortingParams
Sourcepub fn has_unsafe_fields(&self) -> bool
pub fn has_unsafe_fields(&self) -> bool
Check if there are any unsafe fields that need validation
Sourcepub fn with_allowed_columns(
self,
columns: &'static [&'static str],
) -> SortingParams
pub fn with_allowed_columns( self, columns: &'static [&'static str], ) -> SortingParams
Set allowed columns for unsafe field validation
Sourcepub fn validate_fields(&self) -> Result<(), String>
pub fn validate_fields(&self) -> Result<(), String>
Validate all unsafe fields against the whitelist
pub fn push(self, sort: Sort) -> SortingParams
pub fn sort_by( self, field: impl Into<String>, direction: SortDirection, ) -> SortingParams
pub fn asc(self, field: impl Into<String>) -> SortingParams
pub fn desc(self, field: impl Into<String>) -> SortingParams
pub fn is_empty(&self) -> bool
Sourcepub fn apply_nulls_first(self) -> SortingParams
pub fn apply_nulls_first(self) -> SortingParams
Apply NULLS FIRST to the last added sort
Sourcepub fn apply_nulls_last(self) -> SortingParams
pub fn apply_nulls_last(self) -> SortingParams
Apply NULLS LAST to the last added sort
Sourcepub fn apply_nulls_default(self) -> SortingParams
pub fn apply_nulls_default(self) -> SortingParams
Apply default null ordering to the last added sort
Sourcepub fn extend_with(self, other: SortingParams) -> SortingParams
pub fn extend_with(self, other: SortingParams) -> SortingParams
Combine with another SortingParams, extending the sorts list
Trait Implementations§
Source§impl Clone for SortingParams
impl Clone for SortingParams
Source§fn clone(&self) -> SortingParams
fn clone(&self) -> SortingParams
Returns a duplicate of the value. Read more
1.0.0 · 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 SortingParams
impl Debug for SortingParams
Source§impl Default for SortingParams
impl Default for SortingParams
Source§fn default() -> SortingParams
fn default() -> SortingParams
Returns the “default value” for a type. Read more
Source§impl IntoParams for SortingParams
impl IntoParams for SortingParams
fn into_params(self) -> Params
Auto Trait Implementations§
impl Freeze for SortingParams
impl RefUnwindSafe for SortingParams
impl Send for SortingParams
impl Sync for SortingParams
impl Unpin for SortingParams
impl UnwindSafe for SortingParams
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