Struct ordbog::Dict [−][src]
Expand description
A dictionary over an underlying type T
conforming to ValReq. The
dictionary maps underlying values to Codes to use in a sketch, using
Dict::encode.
Fields
mode: Mode
The mode the dictionary was built in.
codes: Vec<T>
A sorted vector of the values assigned exact codes in the dictionary. Implicitly defines both exact and inexact code values based on the positions of exact codes in the vector.
Implementations
Look up the code for a value of the underlying value type T
.
Build a dictionary with a given Mode over a provided sample of the underlying value type.
The provided sample should be representative of the overall data, and specifically should contain duplicates at a similar proportion to those found in the overall data. If the sample is not representative, code accuracy will degrade (thus false positives will increase) but nothing else will go wrong.
This function will sort the sample, so the sample should be small enough that the caller can tolerate the running time of sorting it. Otherwise the larger the sample, the more accurate the codes.
Auto Trait Implementations
impl<T> RefUnwindSafe for Dict<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Dict<T> where
T: UnwindSafe,