pub struct OrderKey<'a> {
pub group: Option<&'a str>,
pub rank: i64,
pub label: &'a str,
pub identity: &'a str,
}Expand description
The four parts of the canonical order, most significant first. See the module documentation for what each part means and why the last one is not optional.
Fields§
§group: Option<&'a str>The semantic bucket, or None for an item that is not filed under one. None
sorts after every named group.
rank: i64The explicit position inside the group, ascending. OrderKey::UNRANKED when the
collection has no such semantics, which is most of them.
label: &'a strWhat a person reads.
identity: &'a strThe canonical id: unique, and therefore the tie-breaker that makes the order total.
Implementations§
Source§impl<'a> OrderKey<'a>
impl<'a> OrderKey<'a>
Sourcepub const UNRANKED: i64 = 0
pub const UNRANKED: i64 = 0
The rank of an item whose collection has no explicit ordering semantics. Zero, so that a collection where only some items are ranked puts those first, which is what an explicit rank is for.
Sourcepub fn plain(label: &'a str, identity: &'a str) -> Self
pub fn plain(label: &'a str, identity: &'a str) -> Self
An item with no group and no explicit rank: ordered by its label, then its identity.
Trait Implementations§
impl<'a> Copy for OrderKey<'a>
impl<'a> Eq for OrderKey<'a>
Source§impl Ord for OrderKey<'_>
impl Ord for OrderKey<'_>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'a> PartialEq for OrderKey<'a>
impl<'a> PartialEq for OrderKey<'a>
Source§impl PartialOrd for OrderKey<'_>
impl PartialOrd for OrderKey<'_>
impl<'a> StructuralPartialEq for OrderKey<'a>
Auto Trait Implementations§
impl<'a> Freeze for OrderKey<'a>
impl<'a> RefUnwindSafe for OrderKey<'a>
impl<'a> Send for OrderKey<'a>
impl<'a> Sync for OrderKey<'a>
impl<'a> Unpin for OrderKey<'a>
impl<'a> UnsafeUnpin for OrderKey<'a>
impl<'a> UnwindSafe for OrderKey<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.