Trait HashKeyDispatcher

Source
pub trait HashKeyDispatcher: Sized {
    type Output;

    // Required methods
    fn dispatch_impl<K: HashKey>(self) -> Self::Output;
    fn data_types(&self) -> &[DataType];

    // Provided methods
    fn dispatch(self) -> Self::Output { ... }
    fn dispatch_by_key_size<T: NullBitmap>(self) -> Self::Output { ... }
}
Expand description

A trait to help to dynamically dispatch HashKey template.

Suppose you want to build a trait object of type T, whose underlying implementation is S<K: HashKey>, you can implement a HashKeyDispatcher with Output=T. Then you can use dispatch_by_kind to build T directly without working with generic argument K.

Required Associated Types§

Required Methods§

Source

fn dispatch_impl<K: HashKey>(self) -> Self::Output

Source

fn data_types(&self) -> &[DataType]

The data types used to build the hash key.

Provided Methods§

Source

fn dispatch(self) -> Self::Output

Based on the number of group keys and total size of group keys, we decide:

  1. What bitmap to use for representing null values in group keys.
  2. What key type to store group keys in.
Source

fn dispatch_by_key_size<T: NullBitmap>(self) -> Self::Output

All data types will be stored in a single HashKey. We use Key<N> for fixed size keys, KeySerialized for variable length keys.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§