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§
fn dispatch_impl<K: HashKey>(self) -> Self::Output
Sourcefn data_types(&self) -> &[DataType]
fn data_types(&self) -> &[DataType]
The data types used to build the hash key.
Provided Methods§
Sourcefn dispatch(self) -> Self::Output
fn dispatch(self) -> Self::Output
Based on the number of group keys and total size of group keys, we decide:
- What bitmap to use for representing null values in group keys.
- What key type to store group keys in.
Sourcefn dispatch_by_key_size<T: NullBitmap>(self) -> Self::Output
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".