Skip to main content

PtarsConfig

Struct PtarsConfig 

Source
pub struct PtarsConfig {
Show 15 fields pub timestamp_tz: Option<Arc<str>>, pub timestamp_unit: TimeUnit, pub time_unit: TimeUnit, pub duration_unit: TimeUnit, pub list_value_name: Arc<str>, pub map_value_name: Arc<str>, pub list_nullable: bool, pub map_nullable: bool, pub list_value_nullable: bool, pub map_value_nullable: bool, pub use_large_string: bool, pub use_large_binary: bool, pub use_large_list: bool, pub enum_repr: EnumRepr, pub confluent_wire_policy: ConfluentWirePolicy,
}
Expand description

Configuration for protobuf to Arrow conversions.

This struct allows customizing how protobuf types are mapped to Arrow types, similar to Python’s ProtarrowConfig.

Fields§

§timestamp_tz: Option<Arc<str>>

Timezone for timestamp values. Default: Some(“UTC”) Set to None for timezone-naive timestamps.

§timestamp_unit: TimeUnit

Time unit for timestamp values. Default: Nanosecond

§time_unit: TimeUnit

Time unit for time of day values. Default: Nanosecond

§duration_unit: TimeUnit

Time unit for duration values. Default: Nanosecond

§list_value_name: Arc<str>

Name for list item field. Default: “item”

§map_value_name: Arc<str>

Name for map value field. Default: “value”

§list_nullable: bool

Whether list fields can be null. Default: false

§map_nullable: bool

Whether map fields can be null. Default: false

§list_value_nullable: bool

Whether list element values can be null. Default: false

§map_value_nullable: bool

Whether map values can be null. Default: false

§use_large_string: bool

Whether to use LargeUtf8 instead of Utf8 for string fields. Default: false

§use_large_binary: bool

Whether to use LargeBinary instead of Binary for bytes fields. Default: false

§use_large_list: bool

Whether to use LargeList instead of List for repeated fields. Default: false

§enum_repr: EnumRepr

How to represent enum fields in Arrow. Default: Int32 When String, use_large_string controls Utf8 vs LargeUtf8. When Binary, use_large_binary controls Binary vs LargeBinary.

§confluent_wire_policy: ConfluentWirePolicy

Policy for stripping Confluent Schema Registry wire format prefix. Default: Raw

Implementations§

Source§

impl PtarsConfig

Source

pub fn new() -> Self

Create a new config with default values.

Source

pub fn with_timestamp_tz(self, tz: Option<&str>) -> Self

Set the timezone for timestamp values.

Source

pub fn with_timestamp_unit(self, unit: TimeUnit) -> Self

Set the time unit for timestamp values.

Source

pub fn with_time_unit(self, unit: TimeUnit) -> Self

Set the time unit for time of day values.

Source

pub fn with_duration_unit(self, unit: TimeUnit) -> Self

Set the time unit for duration values.

Source

pub fn with_list_value_name(self, name: &str) -> Self

Set the name for list item fields.

Source

pub fn with_map_value_name(self, name: &str) -> Self

Set the name for map value fields.

Source

pub fn with_list_nullable(self, nullable: bool) -> Self

Set whether list fields can be null.

Source

pub fn with_map_nullable(self, nullable: bool) -> Self

Set whether map fields can be null.

Source

pub fn with_list_value_nullable(self, nullable: bool) -> Self

Set whether list element values can be null.

Source

pub fn with_map_value_nullable(self, nullable: bool) -> Self

Set whether map values can be null.

Source

pub fn with_use_large_string(self, use_large: bool) -> Self

Set whether to use LargeUtf8 instead of Utf8 for string fields.

Source

pub fn with_use_large_binary(self, use_large: bool) -> Self

Set whether to use LargeBinary instead of Binary for bytes fields.

Source

pub fn with_use_large_list(self, use_large: bool) -> Self

Set whether to use LargeList instead of List for repeated fields.

Source

pub fn with_enum_repr(self, repr: EnumRepr) -> Self

Set how enum fields are represented in Arrow.

Source

pub fn with_confluent_wire_policy(self, policy: ConfluentWirePolicy) -> Self

Set the Confluent Schema Registry wire format policy.

Trait Implementations§

Source§

impl Clone for PtarsConfig

Source§

fn clone(&self) -> PtarsConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PtarsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PtarsConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
Source§

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

Source§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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.

Source§

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.