#[non_exhaustive]pub struct SortConfig {
pub criteria: Vec<(SortCriterion, bool)>,
pub niche: usize,
pub frecency_weight: u64,
pub min_seeders: Option<usize>,
pub max_seeders: Option<usize>,
pub limit_size: Option<u64>,
pub min_depth: Option<usize>,
pub max_depth: Option<usize>,
pub enrich: bool,
}Expand description
Configuration for the sorter.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.criteria: Vec<(SortCriterion, bool)>§niche: usize§frecency_weight: u64§min_seeders: Option<usize>§max_seeders: Option<usize>§limit_size: Option<u64>§min_depth: Option<usize>§max_depth: Option<usize>§enrich: boolImplementations§
Source§impl SortConfig
impl SortConfig
Sourcepub fn parse_criteria(criteria: &[String]) -> Vec<(SortCriterion, bool)>
pub fn parse_criteria(criteria: &[String]) -> Vec<(SortCriterion, bool)>
Parse sort criteria from strings like “-niche”, “-frecency”, “time”.
Sourcepub fn parse_limit_size(s: &str) -> Result<u64, SyncwebError>
pub fn parse_limit_size(s: &str) -> Result<u64, SyncwebError>
Trait Implementations§
Source§impl Clone for SortConfig
impl Clone for SortConfig
Source§fn clone(&self) -> SortConfig
fn clone(&self) -> SortConfig
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 moreSource§impl Debug for SortConfig
impl Debug for SortConfig
Auto Trait Implementations§
impl Freeze for SortConfig
impl RefUnwindSafe for SortConfig
impl Send for SortConfig
impl Sync for SortConfig
impl Unpin for SortConfig
impl UnsafeUnpin for SortConfig
impl UnwindSafe for SortConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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,
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