pub trait FieldEncodingStrategy:
Send
+ Sync
+ Debug {
// Required method
fn create_field_encoder(
&self,
field: &Field,
column_index: &mut ColumnIndexSequence,
context: &FieldEncodingContext<'_>,
) -> Result<Box<dyn FieldEncoder>>;
}Expand description
A trait to pick which kind of field encoding to use for a field
Unlike the ArrayEncodingStrategy, the field encoding strategy is chosen before any data is generated and the same field encoder is used for all data in the field.
Required Methods§
Sourcefn create_field_encoder(
&self,
field: &Field,
column_index: &mut ColumnIndexSequence,
context: &FieldEncodingContext<'_>,
) -> Result<Box<dyn FieldEncoder>>
fn create_field_encoder( &self, field: &Field, column_index: &mut ColumnIndexSequence, context: &FieldEncodingContext<'_>, ) -> Result<Box<dyn FieldEncoder>>
Choose and create an appropriate field encoder for the given field.
The field encoder can be chosen on the data type as well as any metadata that is attached to the field.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".