pub struct DecoderContext {
coerce_primitive: bool,
strict_mode: bool,
struct_mode: StructMode,
ignore_type_conflicts: bool,
decoder_factory: Option<Arc<dyn DecoderFactory>>,
}Expand description
Context for decoder creation, containing configuration.
This context is passed through the decoder creation process and contains all the configuration needed to create decoders recursively.
Fields§
§coerce_primitive: boolWhether to coerce primitives to strings
strict_mode: boolWhether to validate struct fields strictly
struct_mode: StructModeHow to decode struct fields
ignore_type_conflicts: boolWhether to treat columns with incompatible types as missing (i.e. NULL)
decoder_factory: Option<Arc<dyn DecoderFactory>>An optional hook for customizing decoding behavior
Implementations§
Source§impl DecoderContext
impl DecoderContext
Sourcepub fn coerce_primitive(&self) -> bool
pub fn coerce_primitive(&self) -> bool
Returns whether to coerce primitive types (e.g., number to string)
Sourcepub fn strict_mode(&self) -> bool
pub fn strict_mode(&self) -> bool
Returns whether to validate struct fields strictly
Sourcepub fn struct_mode(&self) -> StructMode
pub fn struct_mode(&self) -> StructMode
Returns how to decode struct fields
Sourcepub fn ignore_type_conflicts(&self) -> bool
pub fn ignore_type_conflicts(&self) -> bool
Returns whether to treat columns with incompatible types as missing (i.e. NULL)
Sourcepub fn decoder_factory(&self) -> Option<&Arc<dyn DecoderFactory>>
pub fn decoder_factory(&self) -> Option<&Arc<dyn DecoderFactory>>
Returns the optional hook for customizing decoding behavior
Sourcepub fn make_decoder(
&self,
field: &FieldRef,
is_nullable: bool,
) -> Result<Box<dyn ArrayDecoder>, ArrowError>
pub fn make_decoder( &self, field: &FieldRef, is_nullable: bool, ) -> Result<Box<dyn ArrayDecoder>, ArrowError>
Create a decoder for a type.
This is the standard way to create child decoders from within a decoder implementation.
Sourcepub fn make_builtin_decoder(
&self,
field: &FieldRef,
is_nullable: bool,
) -> Result<Box<dyn ArrayDecoder>, ArrowError>
pub fn make_builtin_decoder( &self, field: &FieldRef, is_nullable: bool, ) -> Result<Box<dyn ArrayDecoder>, ArrowError>
Create the decoder the reader would use for field, ignoring any
DecoderFactory.
Lets a factory build on the reader’s own decoder, including for the field it was
asked about — which Self::make_decoder cannot do without looping.