pub enum Sort {
Desc,
Asc,
Unsorted,
}Expand description
Sort order by count.
§Examples
use word_tally::Sort;
assert_eq!(Sort::default(), Sort::Desc);
assert_eq!(Sort::Desc.to_string(), "desc");
assert_eq!(Sort::Asc.to_string(), "asc");
assert_eq!(Sort::Unsorted.to_string(), "unsorted");Variants§
Implementations§
Source§impl Sort
impl Sort
Sourcepub const fn should_sort(&self) -> bool
pub const fn should_sort(&self) -> bool
Returns true if sorting should be applied.
Sourcepub const fn is_descending(&self) -> bool
pub const fn is_descending(&self) -> bool
Returns true if sorting should be in descending order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sort
impl<'de> Deserialize<'de> for Sort
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
Source§impl Ord for Sort
impl Ord for Sort
Source§impl PartialOrd for Sort
impl PartialOrd for Sort
impl Copy for Sort
impl Eq for Sort
impl StructuralPartialEq for Sort
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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<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