pub struct ValueDictionary { /* private fields */ }Expand description
Per-collection value dictionary.
Implementations§
Source§impl ValueDictionary
impl ValueDictionary
Sourcepub fn new(config: ValueDictionaryConfig) -> Self
pub fn new(config: ValueDictionaryConfig) -> Self
Create a dictionary with custom configuration.
Sourcepub fn encode(
&mut self,
field_id: FieldId,
value: &[u8],
) -> Result<StoredValue, DictionaryError>
pub fn encode( &mut self, field_id: FieldId, value: &[u8], ) -> Result<StoredValue, DictionaryError>
Encode a value for a field.
Values are dictionary-encoded only when:
- observed field cardinality is below
low_cardinality_threshold, and - value length is at least
min_len_for_dictionary.
Sourcepub fn decode(&self, stored: &StoredValue) -> Result<Vec<u8>, DictionaryError>
pub fn decode(&self, stored: &StoredValue) -> Result<Vec<u8>, DictionaryError>
Decode a stored value back to owned bytes.
Sourcepub fn cardinality_estimate(&self, field_id: FieldId) -> usize
pub fn cardinality_estimate(&self, field_id: FieldId) -> usize
Return the configured cardinality estimate for a field.
Trait Implementations§
Source§impl Debug for ValueDictionary
impl Debug for ValueDictionary
Source§impl Default for ValueDictionary
impl Default for ValueDictionary
Source§fn default() -> ValueDictionary
fn default() -> ValueDictionary
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValueDictionary
impl RefUnwindSafe for ValueDictionary
impl Send for ValueDictionary
impl Sync for ValueDictionary
impl Unpin for ValueDictionary
impl UnsafeUnpin for ValueDictionary
impl UnwindSafe for ValueDictionary
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