pub enum SearchSort {
Relevance,
PublishedAt,
Title,
}Expand description
What a search is ordered by.
Serializable so a front-end can echo the order it applied, with the variant
names matching what SearchSort::parse accepts — published_at, not
PublishedAt.
Variants§
Implementations§
Source§impl SearchSort
impl SearchSort
Sourcepub fn parse(raw: &str) -> Result<Self, InvalidQuery>
pub fn parse(raw: &str) -> Result<Self, InvalidQuery>
Parses a sort key, or explains what was expected.
An unknown key is refused rather than ignored, for the same reason an
unknown field is: a search that quietly ignored the sort it was asked
for looks exactly like one that honoured it. score is deliberately not
accepted — ts_rank is not comparable across tiers, which is the reason
the tiers exist.
Trait Implementations§
Source§impl Clone for SearchSort
impl Clone for SearchSort
impl Copy for SearchSort
Source§impl Debug for SearchSort
impl Debug for SearchSort
Source§impl Default for SearchSort
impl Default for SearchSort
Source§impl<'de> Deserialize<'de> for SearchSort
impl<'de> Deserialize<'de> for SearchSort
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
impl Eq for SearchSort
Source§impl FromStr for SearchSort
impl FromStr for SearchSort
Source§impl PartialEq for SearchSort
impl PartialEq for SearchSort
Source§impl Serialize for SearchSort
impl Serialize for SearchSort
impl StructuralPartialEq for SearchSort
Auto Trait Implementations§
impl Forget for SearchSort
impl Freeze for SearchSort
impl Move for SearchSort
impl RefUnwindSafe for SearchSort
impl Send for SearchSort
impl Sync for SearchSort
impl Unpin for SearchSort
impl UnsafeUnpin for SearchSort
impl UnwindSafe for SearchSort
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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