#[non_exhaustive]pub struct Options {
pub radius: u32,
pub limit: Option<usize>,
pub max_matches: Option<usize>,
pub time_budget: Option<Duration>,
pub threads: usize,
pub exclude_zero: bool,
}Expand description
How to run a search.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.radius: u32Every record within this Hamming distance of the query is a match.
limit: Option<usize>Return only the nearest limit matches by distance. None returns all.
max_matches: Option<usize>A size budget: hold at most this many matches per query, the nearest by distance. It bounds
the memory a search holds as well as the result: at most max_hits of it, about twice
this many, hits a query and thread.
time_budget: Option<Duration>A search budget: the search stops collecting candidates once this much time has passed,
and keeps only the matches at distance 0 it found, the only ones proven nearest (see
Found::cut_by); the result follows as soon as what was collected is merged. The clock
is read between runs of about a thousand records’ work, so collecting stops within one run
of the deadline; merging, sorting and building the result come after it. A budget too long
to add to the clock is no budget.
threads: usizeThreads to split the search across; 0 counts as 1. A variant that plans may use fewer for
a call it expects to be short: see Search::plan.
exclude_zero: boolLeave records whose value is all zeros out of the results.
Implementations§
Source§impl Options
impl Options
Sourcepub const fn new(radius: u32) -> Self
pub const fn new(radius: u32) -> Self
Every match within radius, on one thread, with no budget.
Sourcepub const fn max_matches(self, max_matches: usize) -> Self
pub const fn max_matches(self, max_matches: usize) -> Self
Hold at most max_matches matches per query.
Sourcepub const fn time_budget(self, budget: Duration) -> Self
pub const fn time_budget(self, budget: Duration) -> Self
Stop after budget.
Sourcepub const fn exclude_zero(self, exclude: bool) -> Self
pub const fn exclude_zero(self, exclude: bool) -> Self
Leave all-zero values out of the results.