pub struct DefaultTableConfig();
Expand description

A struct that implements TableConfig with default values. This can be passed as a convenience when a default configuration for Table is acceptable

Trait Implementations§

source§

impl TableConfig for DefaultTableConfig

§

type KeyCharT = char

A generic type that specifies the unit of deletion for the SymSpell algorithm.
Valid Key types for a Table must be losslessly convertible to and from Vec<KeyCharT>. Read more
§

type DistanceT = u8

A generic type that represents a scalar distance in the Metric Space that contains all keys in the Table. A DistanceT is the return type of the DISTANCE_FUNCTION. Read more
§

type ValueT = String

A generic type that represents a payload value associated with a record. ValueT must be able to be serialized and deserialized from the database but otherwise is not constrained.
§

type CoderT = BincodeCoder

The [Coder] interface to use to encode and decode the objects in the database. Currently this should be either BincodeCoder or MsgPackCoder. Alternatively, use DefaultCoder for the coder selected by the crate features
source§

const UTF8_KEYS: bool = true

A const bool that specifies whether the keys are UTF-8 encoded Unicode strings or not. Read more
source§

const MAX_DELETES: usize = 2usize

The number of deletes to store in the database for variants created by the SymSpell optimization. If MAX_DELETES is too small, the variant will not be found and therefore the DISTANCE_FUNCTION will not have an opportunity to evaluate the match. However, if MAX_DELETES is too large, it will hurt performance by finding and evaluating too many candidate keys. Read more
source§

const MEANINGFUL_KEY_LEN: usize = 12usize

MEANINGFUL_KEY_LEN controls an optimization where only a subset of the key is used for creating variants. For example, if MEANINGFUL_KEY_LEN = 10 then only the first 10 characters of the key will be used to generate and search for variants. Read more
source§

const GROUP_VARIANT_OVERLAP_THRESHOLD: usize = 5usize

The number of variants a given key must share with the other keys in an existing key group, in order for the key to be added to the key group rather than being placed into a new separate key group. Read more
source§

const DISTANCE_FUNCTION: DistanceFunction<Self::KeyCharT, Self::DistanceT> = {<table_config::DefaultTableConfig as table_config::TableConfig>::levenstein_distance as for<'a, 'b> fn(&'a [<table_config::DefaultTableConfig as table_config::TableConfig>::KeyCharT], &'b [<table_config::DefaultTableConfig as table_config::TableConfig>::KeyCharT]) -> <table_config::DefaultTableConfig as table_config::TableConfig>::DistanceT}

The DISTANCE_FUNCTION is a DistanceFunction associated with a Table and defines the Metric Space that contains all Keys in the Table.
source§

fn levenstein_distance( key_a: &[Self::KeyCharT], key_b: &[Self::KeyCharT] ) -> Self::DistanceT

An implementation of the basic Levenstein Distance function, which is used by the DefaultTableConfig, and may be used anywhere a distance function is required. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.