pub struct CompressionConfig { /* private fields */ }Expand description
Compression configuration for Parquet file writing.
Controls which compression algorithm is used and its level (for algorithms that support configurable compression levels).
§Examples
use dbx_core::storage::compression::{CompressionConfig, CompressionAlgorithm};
// Default (Snappy)
let config = CompressionConfig::default();
// ZSTD with level 3 (balanced)
let config = CompressionConfig::new(CompressionAlgorithm::Zstd).with_level(3);
// Convert to Parquet compression setting
let parquet_compression = config.to_parquet_compression();Implementations§
Source§impl CompressionConfig
impl CompressionConfig
Sourcepub fn new(algorithm: CompressionAlgorithm) -> Self
pub fn new(algorithm: CompressionAlgorithm) -> Self
Create a new compression config with the specified algorithm.
Sourcepub fn with_level(self, level: u32) -> Self
pub fn with_level(self, level: u32) -> Self
Set the compression level (for ZSTD and Brotli only).
Levels are clamped to valid ranges:
- ZSTD: 1-22
- Brotli: 0-11
- Others: ignored
Sourcepub fn algorithm(&self) -> CompressionAlgorithm
pub fn algorithm(&self) -> CompressionAlgorithm
Get the configured algorithm.
Sourcepub fn to_parquet_compression(&self) -> Compression
pub fn to_parquet_compression(&self) -> Compression
Convert to Parquet’s Compression enum for use in WriterProperties.
Sourcepub fn zstd_level(level: u32) -> Self
pub fn zstd_level(level: u32) -> Self
Preset: ZSTD with specified compression level (1-22).
Sourcepub fn brotli_level(level: u32) -> Self
pub fn brotli_level(level: u32) -> Self
Preset: Brotli with specified compression level (0-11).
Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§fn clone(&self) -> CompressionConfig
fn clone(&self) -> CompressionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompressionConfig
impl Debug for CompressionConfig
Source§impl Default for CompressionConfig
impl Default for CompressionConfig
Source§impl PartialEq for CompressionConfig
impl PartialEq for CompressionConfig
impl Copy for CompressionConfig
impl Eq for CompressionConfig
impl StructuralPartialEq for CompressionConfig
Auto Trait Implementations§
impl Freeze for CompressionConfig
impl RefUnwindSafe for CompressionConfig
impl Send for CompressionConfig
impl Sync for CompressionConfig
impl Unpin for CompressionConfig
impl UnsafeUnpin for CompressionConfig
impl UnwindSafe for CompressionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more