Struct fuzzy_rocks::DefaultTableConfig
source · 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
impl TableConfig for DefaultTableConfig
§type DistanceT = u8
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
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
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 MAX_DELETES: usize = 2usize
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 moresource§const MEANINGFUL_KEY_LEN: usize = 12usize
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 moresource§const GROUP_VARIANT_OVERLAP_THRESHOLD: usize = 5usize
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}
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
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§
impl RefUnwindSafe for DefaultTableConfig
impl Send for DefaultTableConfig
impl Sync for DefaultTableConfig
impl Unpin for DefaultTableConfig
impl UnwindSafe for DefaultTableConfig
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
Mutably borrows from an owned value. Read more