pub struct NumericPrefixWithSuffix<'a>(/* private fields */);Expand description
A way to sort strings with starting numbers numerically first, falling back to alphanumeric one, case-insensitive.
This is useful for turning regular alphanumerically sorted sequences as 1-abc, 10, 11-def, .., 2, 21-abc
into 1-abc, 2, 10, 11-def, .., 21-abc
Implementations§
Source§impl<'a> NumericPrefixWithSuffix<'a>
impl<'a> NumericPrefixWithSuffix<'a>
pub fn from_numeric_prefixed_str(str: &'a str) -> Self
Trait Implementations§
Source§impl<'a> Debug for NumericPrefixWithSuffix<'a>
impl<'a> Debug for NumericPrefixWithSuffix<'a>
Source§impl Ord for NumericPrefixWithSuffix<'_>
When dealing with equality, we need to consider the case of the strings to achieve strict equality
to handle cases like “a” < “A” instead of “a” == “A”.
impl Ord for NumericPrefixWithSuffix<'_>
When dealing with equality, we need to consider the case of the strings to achieve strict equality to handle cases like “a” < “A” instead of “a” == “A”.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for NumericPrefixWithSuffix<'a>
impl<'a> PartialEq for NumericPrefixWithSuffix<'a>
Source§fn eq(&self, other: &NumericPrefixWithSuffix<'a>) -> bool
fn eq(&self, other: &NumericPrefixWithSuffix<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for NumericPrefixWithSuffix<'_>
impl PartialOrd for NumericPrefixWithSuffix<'_>
impl<'a> Eq for NumericPrefixWithSuffix<'a>
impl<'a> StructuralPartialEq for NumericPrefixWithSuffix<'a>
Auto Trait Implementations§
impl<'a> Freeze for NumericPrefixWithSuffix<'a>
impl<'a> RefUnwindSafe for NumericPrefixWithSuffix<'a>
impl<'a> Send for NumericPrefixWithSuffix<'a>
impl<'a> Sync for NumericPrefixWithSuffix<'a>
impl<'a> Unpin for NumericPrefixWithSuffix<'a>
impl<'a> UnsafeUnpin for NumericPrefixWithSuffix<'a>
impl<'a> UnwindSafe for NumericPrefixWithSuffix<'a>
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<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§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