Skip to main content

IpcWriteOptions

Struct IpcWriteOptions 

Source
pub struct IpcWriteOptions {
    alignment: u8,
    write_legacy_ipc_format: bool,
    metadata_version: MetadataVersion,
    batch_compression_type: Option<CompressionType>,
    batch_compression_level: Option<i32>,
    batch_lz4_block_size: Option<Lz4BlockSize>,
    dictionary_handling: DictionaryHandling,
}
Expand description

IPC write options used to control the behaviour of the IpcDataGenerator

Fields§

§alignment: u8

Write padding after memory buffers to this multiple of bytes. Must be 8, 16, 32, or 64 - defaults to 64.

§write_legacy_ipc_format: bool

The legacy format is for releases before 0.15.0, and uses metadata V4

§metadata_version: MetadataVersion

The metadata version to write. The Rust IPC writer supports V4+

Default versions per crate

When creating the default IpcWriteOptions, the following metadata versions are used:

version 2.0.0: V4, with legacy format enabled version 4.0.0: V5

§batch_compression_type: Option<CompressionType>

Compression, if desired. Will result in a runtime error if the corresponding feature is not enabled

§batch_compression_level: Option<i32>§batch_lz4_block_size: Option<Lz4BlockSize>

The lz4 frame block size; None selects 256 KiB.

§dictionary_handling: DictionaryHandling

How to handle updating dictionaries in IPC messages

Implementations§

Source§

impl IpcWriteOptions

Source

pub fn try_with_compression( self, batch_compression_type: Option<CompressionType>, ) -> Result<Self, ArrowError>

Configures compression when writing IPC files.

Will result in a runtime error if the corresponding feature is not enabled

Source

pub fn try_with_compression_level( self, batch_compression_level: Option<i32>, ) -> Result<Self, ArrowError>

Configures the compression level used when writing compressed IPC batches.

Compression levels require metadata V5 or newer and are currently only supported for ZSTD compression.

Source

pub fn try_with_lz4_block_size( self, block_size: Option<usize>, ) -> Result<Self, ArrowError>

Configures the lz4 frame block size used when compressing batches with crate::CompressionType::LZ4_FRAME.

None restores the default of 256 KiB, which balances compression throughput against the buffers retained by the reusable encoder. The LZ4 frame header can only describe the block sizes 64 KiB, 256 KiB, 1 MiB and 4 MiB; any other value returns an [ArrowError::InvalidArgumentError]. Like the other compression settings this requires metadata version V5 or newer, and it has no effect when another compression codec is selected.

Source

pub(crate) fn lz4_block_size(&self) -> Lz4BlockSize

The lz4 frame block size to compress with, in bytes.

Source

fn check_zstd_level(self, level: i32) -> Result<Self, ArrowError>

Source

pub fn try_new( alignment: usize, write_legacy_ipc_format: bool, metadata_version: MetadataVersion, ) -> Result<Self, ArrowError>

Try to create IpcWriteOptions, checking for incompatible settings

Source

pub fn with_dictionary_handling( self, dictionary_handling: DictionaryHandling, ) -> Self

Configure how dictionaries are handled in IPC messages

Trait Implementations§

Source§

impl Clone for IpcWriteOptions

Source§

fn clone(&self) -> Self

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 IpcWriteOptions

Source§

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

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

impl Default for IpcWriteOptions

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

§

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
§

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> 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.

§

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 = !

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.