[−][src]Struct sublime_fuzzy::FuzzySearch
Describes a fuzzy search. Alternative to best_match
which allows for more configuration.
Examples
Basic usage:
use sublime_fuzzy::{FuzzySearch, Scoring}; let scoring = Scoring::emphasize_word_starts(); let result = FuzzySearch::new("something", "Some Search Thing") .score_with(&scoring) .case_insensitive() .best_match(); assert!(result.is_some());
Implementations
impl<'a> FuzzySearch<'a>
[src]
pub fn new(query: &'a str, target: &'a str) -> Self
[src]
Creates a new search to match query
in target
.
Note that whitespace in query will be ignored.
pub fn score_with(self, scoring: &'a Scoring) -> Self
[src]
Use custom scoring values.
If not specified will use Scoring::default()
.
pub fn case_sensitive(self) -> Self
[src]
Only match query chars in the target string if case matches.
Scoring::bonus_match_case
will not be applied if this is set (because a char match will
always also be a case match).
pub fn case_insensitive(self) -> Self
[src]
Ignore case when matching query chars in the target string.
If not only the char but also the case matches, Scoring::bonus_match_case
will be added to
the score. If that behavior is not wanted the bonus can be set to 0 with custom scoring.
pub fn best_match(self) -> Option<Match>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for FuzzySearch<'a>
[src]
impl<'a> Send for FuzzySearch<'a>
[src]
impl<'a> Sync for FuzzySearch<'a>
[src]
impl<'a> Unpin for FuzzySearch<'a>
[src]
impl<'a> UnwindSafe for FuzzySearch<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,