[−][src]Struct sublime_fuzzy::Scoring
Bonuses/penalties used for scoring a Match
.
Fields
bonus_consecutive: isize
current_consecutive_count * bonus_consecutive
will be added for every
consecutive char match.
1 * bonus
for the first consecutive match, 2 * bonus
for
the second, etc.
bonus_word_start: isize
Added when a query char matches a word start.
bonus_match_case: isize
Added when the matched query char also matches the case of the target char.
Only applied if the search is case insensitive.
penalty_distance: isize
Subtracted from the score for every char between two matches.
Implementations
impl Scoring
[src]
pub fn new(
bonus_consecutive: isize,
bonus_word_start: isize,
bonus_match_case: isize,
penalty_distance: isize
) -> Self
[src]
bonus_consecutive: isize,
bonus_word_start: isize,
bonus_match_case: isize,
penalty_distance: isize
) -> Self
Creates a new configuration with the given bonuses/penalties.
pub fn emphasize_word_starts() -> Self
[src]
Creates a configuration that emphasizes matching word starts (this is also the default).
pub fn emphasize_distance() -> Self
[src]
Creates a configuration that emphasizes short distances between matched chars.
Trait Implementations
impl Clone for Scoring
[src]
impl Debug for Scoring
[src]
impl Default for Scoring
[src]
pub fn default() -> Self
[src]
Creates a default configuration, see Scoring::emphasize_word_starts
.
Auto Trait Implementations
impl RefUnwindSafe for Scoring
[src]
impl Send for Scoring
[src]
impl Sync for Scoring
[src]
impl Unpin for Scoring
[src]
impl UnwindSafe for Scoring
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,