pub struct PatternConfig {
pub max_typos: Option<u16>,
pub casing: Option<CaseMatching>,
pub unicode: Option<UnicodeMatching>,
pub matching: Option<Matching>,
pub scoring: Option<Scoring>,
}Expand description
Per-pattern overrides for the matcher’s Config. Every field is optional
and falls back to the matcher’s Config when left as None (see
PatternConfig::resolve)
Fields§
§max_typos: Option<u16>Per-pattern override for crate::Config::max_typos; None inherits
it.
Because crate::Config::max_typos is itself Option, there is no way
to request unlimited typos for a single pattern while the matcher’s
config sets a limit.
casing: Option<CaseMatching>Per-pattern override for crate::Config::casing; None inherits it.
unicode: Option<UnicodeMatching>Per-pattern override for crate::Config::unicode; None inherits it.
matching: Option<Matching>Per-pattern override for crate::Config::matching; None inherits
it.
scoring: Option<Scoring>Per-pattern override for crate::Config::scoring; None inherits it.
Implementations§
Source§impl PatternConfig
impl PatternConfig
Sourcepub fn resolve(&self, config: &Config) -> Config
pub fn resolve(&self, config: &Config) -> Config
Resolves this pattern’s overrides against the matcher’s Config,
using the matcher’s value for any field left as None. The returned
config’s sort is always the matcher’s, as result ordering isn’t a
per-pattern concern.
Sourcepub fn max_typos(self, max_typos: Option<u16>) -> Self
pub fn max_typos(self, max_typos: Option<u16>) -> Self
Sets the maximum number of typos allowed
Sourcepub fn casing(self, casing: Option<CaseMatching>) -> Self
pub fn casing(self, casing: Option<CaseMatching>) -> Self
Sets the casing mode
Sourcepub fn unicode(self, unicode: Option<UnicodeMatching>) -> Self
pub fn unicode(self, unicode: Option<UnicodeMatching>) -> Self
Sets the unicode mode