pub struct Sort { /* private fields */ }Expand description
A full sort clause
Implementations§
Source§impl Sort
impl Sort
pub fn new(fields: Vec<SortBy>) -> Self
Sourcepub fn field<S: Into<String>>(fieldname: S) -> Self
pub fn field<S: Into<String>>(fieldname: S) -> Self
Convenience function for a single field default
pub fn field_order<S: Into<String>>(fieldname: S, order: Order) -> Self
pub fn fields<S: Into<String>>(fieldnames: Vec<S>) -> Self
pub fn field_orders<S: Into<String>>(fields: Vec<(S, Order)>) -> Self
Trait Implementations§
Source§impl<'a> From<&'a Sort> for OptionVal
Conversion of a Sort into an OptionVal for use in search-by-URI queries
impl<'a> From<&'a Sort> for OptionVal
Conversion of a Sort into an OptionVal for use in search-by-URI queries
use rs_es::operations::common::OptionVal;
use rs_es::operations::search::{Sort, SortField, Order};
let sort = Sort::new(vec![SortField::new("a", Some(Order::Asc)).build(),
SortField::new("b", None).build()]);
let op_val:OptionVal = (&sort).into();
assert_eq!("a:asc,b", op_val.0);Auto Trait Implementations§
impl Freeze for Sort
impl RefUnwindSafe for Sort
impl Send for Sort
impl Sync for Sort
impl Unpin for Sort
impl UnwindSafe for Sort
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more