#[non_exhaustive]pub struct Config {
pub normalize: bool,
pub ignore_case: bool,
pub prefer_prefix: bool,
/* private fields */
}Expand description
Configuration data that controls matcher behaviour.
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.normalize: boolWhether to normalize latin script characters to ASCII (enabled by default).
ignore_case: boolWhether to ignore casing.
prefer_prefix: boolWhether to provide a bonus to matches by their distance from the start
of the haystack. The bonus is fairly small compared to the normal gap
penalty to avoid messing with the normal score heuristic. This setting
is not turned on by default and only recommended for autocompletion
usecases where the expectation is that the user is typing the entire
match. For a full fzf-like fuzzy matcher/picker word segmentation and
explicit prefix literals should be used instead.
Implementations§
Source§impl Config
impl Config
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The default configuration for nucleo, implemented as a constant since
Default::default cannot be called in a const context.
Source§impl Config
impl Config
Sourcepub fn set_match_paths(&mut self)
pub fn set_match_paths(&mut self)
Configures the matcher with bonuses appropriate for matching file paths.
Sourcepub const fn match_paths(self) -> Self
pub const fn match_paths(self) -> Self
Configures the matcher with bonuses appropriate for matching file paths.