Struct ordbog::Dict[][src]

pub struct Dict<T: ValReq> {
    pub mode: Mode,
    pub codes: Vec<T>,
}
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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.