pub struct EngineConfigurationBuilder { /* private fields */ }Expand description
Builder for EngineConfiguration.
Implementations§
Source§impl EngineConfigurationBuilder
impl EngineConfigurationBuilder
Sourcepub fn block_size(self, bytes: u32) -> Self
pub fn block_size(self, bytes: u32) -> Self
Set the uncompressed block size in bytes.
Sourcepub fn compression_level(self, level: u8) -> Self
pub fn compression_level(self, level: u8) -> Self
Set the DEFLATE compression level (0–9).
Sourcepub fn max_expansion_ratio(self, ratio: f64) -> Self
pub fn max_expansion_ratio(self, ratio: f64) -> Self
Set the maximum expansion ratio for incompressible block detection.
Sourcepub fn max_decompression_ratio(self, ratio: f64) -> Self
pub fn max_decompression_ratio(self, ratio: f64) -> Self
Set the maximum decompression expansion ratio.
Sourcepub fn progress(self, cb: Arc<Mutex<ProgressCallback>>) -> Self
pub fn progress(self, cb: Arc<Mutex<ProgressCallback>>) -> Self
Attach a progress callback.
Sourcepub fn build(self) -> Result<EngineConfiguration>
pub fn build(self) -> Result<EngineConfiguration>
Validate all fields and return the built configuration.
§Errors
Returns crush_core::error::CrushError::InvalidConfig if any field is out of range.
Trait Implementations§
Source§impl Default for EngineConfigurationBuilder
impl Default for EngineConfigurationBuilder
Source§fn default() -> EngineConfigurationBuilder
fn default() -> EngineConfigurationBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EngineConfigurationBuilder
impl !RefUnwindSafe for EngineConfigurationBuilder
impl Send for EngineConfigurationBuilder
impl Sync for EngineConfigurationBuilder
impl Unpin for EngineConfigurationBuilder
impl UnsafeUnpin for EngineConfigurationBuilder
impl !UnwindSafe for EngineConfigurationBuilder
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> 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