[][src]Struct sublime_fuzzy::Scoring

pub struct Scoring {
    pub bonus_consecutive: isize,
    pub bonus_word_start: isize,
    pub bonus_match_case: isize,
    pub penalty_distance: isize,
}

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.