#[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: Config
pub const DEFAULT: Config
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) -> Config
pub const fn match_paths(self) -> Config
Configures the matcher with bonuses appropriate for matching file paths.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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