Skip to main content

DecoderContext

Struct DecoderContext 

Source
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: bool

Whether to coerce primitives to strings

§strict_mode: bool

Whether to validate struct fields strictly

§struct_mode: StructMode

How to decode struct fields

§ignore_type_conflicts: bool

Whether 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

Source

pub fn coerce_primitive(&self) -> bool

Returns whether to coerce primitive types (e.g., number to string)

Source

pub fn strict_mode(&self) -> bool

Returns whether to validate struct fields strictly

Source

pub fn struct_mode(&self) -> StructMode

Returns how to decode struct fields

Source

pub fn ignore_type_conflicts(&self) -> bool

Returns whether to treat columns with incompatible types as missing (i.e. NULL)

Source

pub fn decoder_factory(&self) -> Option<&Arc<dyn DecoderFactory>>

Returns the optional hook for customizing decoding behavior

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.