Skip to main content

SortBuilder

Struct SortBuilder 

Source
pub struct SortBuilder<P = (), S = Safe> { /* private fields */ }

Implementations§

Source§

impl SortBuilder

Source

pub fn new() -> SortBuilder

Create as standalone (no parent) - Safe by default

Source

pub fn build(self) -> Option<SortingParams>

Finish and return only the sorting params

Source§

impl<P> SortBuilder<P>

Source

pub fn asc(self, field: &'static str) -> SortBuilder<P>

Safe ASC ordering - only accepts static string literals (compile-time safe)

Source

pub fn desc(self, field: &'static str) -> SortBuilder<P>

Safe DESC ordering - only accepts static string literals (compile-time safe)

Source

pub fn with_allowed_columns( self, allowed_columns: &'static [&'static str], ) -> SortBuilder<P, Unsafe>

Switch to unsafe mode with column whitelist for dynamic strings

Source§

impl SortBuilder<(), Unsafe>

Source

pub fn build(self) -> Option<SortingParams>

Finish and return only the sorting params

Source§

impl<P> SortBuilder<P, Unsafe>

Source

pub fn asc_unsafe(self, field: impl Into<String>) -> SortBuilder<P, Unsafe>

Unsafe ASC ordering - accepts dynamic strings (validation deferred to runtime)

Source

pub fn desc_unsafe(self, field: impl Into<String>) -> SortBuilder<P, Unsafe>

Unsafe DESC ordering - accepts dynamic strings (validation deferred to runtime)

Source§

impl<P, S> SortBuilder<P, S>

Source

pub fn nulls_first(self) -> SortBuilder<P, S>

Apply NULLS FIRST to the last added sort

Source

pub fn nulls_last(self) -> SortBuilder<P, S>

Apply NULLS LAST to the last added sort

Source

pub fn nulls_default(self) -> SortBuilder<P, S>

Apply default null ordering to the last added sort

Source

pub fn done(self) -> P
where P: HasParams,

Finish and return to parent

Trait Implementations§

Source§

impl<S> Debug for SortBuilder<(), S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for SortBuilder

Source§

fn default() -> SortBuilder

Returns the “default value” for a type. Read more
Source§

impl<S> IntoParams for SortBuilder<(), S>

Auto Trait Implementations§

§

impl<P, S> Freeze for SortBuilder<P, S>
where P: Freeze,

§

impl<P, S> RefUnwindSafe for SortBuilder<P, S>

§

impl<P, S> Send for SortBuilder<P, S>
where P: Send, S: Send,

§

impl<P, S> Sync for SortBuilder<P, S>
where P: Sync, S: Sync,

§

impl<P, S> Unpin for SortBuilder<P, S>
where P: Unpin, S: Unpin,

§

impl<P, S> UnwindSafe for SortBuilder<P, S>
where P: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.