pub enum SortStrategy {
ScoreThenIndexAsc,
ScoreThenIndexDesc,
IndexAsc,
IndexDesc,
Unsorted,
}Variants§
ScoreThenIndexAsc
Sort by descending score, then ascending haystack index
ScoreThenIndexDesc
Sort by descending score, then descending haystack index
IndexAsc
Sort by ascending haystack index, preserving input order
IndexDesc
Sort by descending haystack index, reversing input order
Unsorted
No ordering guarantee: the cheapest strategy, for callers that re-sort the matches themselves. Sequential matching yields input order; parallel matching yields the per-thread runs concatenated instead of merged.
Implementations§
Source§impl SortStrategy
impl SortStrategy
pub fn reverse(self) -> Self
Sourcepub fn is_reversed(self) -> bool
pub fn is_reversed(self) -> bool
Whether the sort strategy matches index (asc) (normal order) or index (desc) (reverse order).
When this is true, the sort strategy may still sort by score (desc)
first, see SortStrategy::is_by_score.
Sourcepub fn is_by_score(self) -> bool
pub fn is_by_score(self) -> bool
Whether the sort strategy matches by score (desc) first
Trait Implementations§
Source§impl Clone for SortStrategy
impl Clone for SortStrategy
Source§fn clone(&self) -> SortStrategy
fn clone(&self) -> SortStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SortStrategy
Source§impl Debug for SortStrategy
impl Debug for SortStrategy
Source§impl Default for SortStrategy
impl Default for SortStrategy
Source§fn default() -> SortStrategy
fn default() -> SortStrategy
Returns the “default value” for a type. Read more
impl Eq for SortStrategy
Source§impl PartialEq for SortStrategy
impl PartialEq for SortStrategy
impl StructuralPartialEq for SortStrategy
Auto Trait Implementations§
impl Freeze for SortStrategy
impl RefUnwindSafe for SortStrategy
impl Send for SortStrategy
impl Sync for SortStrategy
impl Unpin for SortStrategy
impl UnsafeUnpin for SortStrategy
impl UnwindSafe for SortStrategy
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