pub struct CompressionOptions {
pub zstd_compression_level: i32,
pub size_estimator_fn: SizeEstimatorFn,
pub lz_match_multiplier: f64,
pub entropy_multiplier: f64,
}
Expand description
Options to configure the behavior of compression when analysing schemas.
Fields§
§zstd_compression_level: i32
The zstd compression level to use. Usually ‘7’ is good enough to represent the data well at runtime, but we default to higher for accuracy when analyzing.
size_estimator_fn: SizeEstimatorFn
Function pointer to use for size estimation.
The function takes SizeEstimationParameters
and returns the estimated size in bytes.
lz_match_multiplier: f64
LZ Match Multiplier (user provided)
entropy_multiplier: f64
Entropy Multiplier (user provided)
Implementations§
Source§impl CompressionOptions
impl CompressionOptions
Sourcepub fn with_zstd_compression_level(self, level: i32) -> Self
pub fn with_zstd_compression_level(self, level: i32) -> Self
Sets the zstd compression level. Usually ‘7’ is good enough to represent the data well at runtime, but we default to higher for accuracy when analyzing.
Sourcepub fn with_size_estimator_fn(self, estimator_fn: SizeEstimatorFn) -> Self
pub fn with_size_estimator_fn(self, estimator_fn: SizeEstimatorFn) -> Self
Sets the size estimator function.
The function takes in the uncompressed data
and SizeEstimationParameters
and returns the estimated size of the compressed data in bytes.
Trait Implementations§
Source§impl Clone for CompressionOptions
impl Clone for CompressionOptions
Source§fn clone(&self) -> CompressionOptions
fn clone(&self) -> CompressionOptions
Returns a copy 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 CompressionOptions
impl Debug for CompressionOptions
Source§impl Default for CompressionOptions
impl Default for CompressionOptions
impl Copy for CompressionOptions
Auto Trait Implementations§
impl Freeze for CompressionOptions
impl RefUnwindSafe for CompressionOptions
impl Send for CompressionOptions
impl Sync for CompressionOptions
impl Unpin for CompressionOptions
impl UnwindSafe for CompressionOptions
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<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