pub struct ConfigConstraints {
pub required_backend: Option<QuantBackend>,
pub min_bits: Option<u32>,
pub max_memory: Option<usize>,
pub target_compression: Option<f32>,
}Expand description
Constraints for configuration selection
Fields§
§required_backend: Option<QuantBackend>Required backend (if any)
min_bits: Option<u32>Minimum number of quantization bits
max_memory: Option<usize>Maximum memory usage (bytes)
target_compression: Option<f32>Target compression ratio
Implementations§
Source§impl ConfigConstraints
impl ConfigConstraints
Sourcepub fn with_backend(self, backend: QuantBackend) -> Self
pub fn with_backend(self, backend: QuantBackend) -> Self
Set required backend
Sourcepub fn with_min_bits(self, bits: u32) -> Self
pub fn with_min_bits(self, bits: u32) -> Self
Set minimum bits
Sourcepub fn with_max_memory(self, bytes: usize) -> Self
pub fn with_max_memory(self, bytes: usize) -> Self
Set maximum memory
Sourcepub fn with_target_compression(self, ratio: f32) -> Self
pub fn with_target_compression(self, ratio: f32) -> Self
Set target compression ratio
Trait Implementations§
Source§impl Clone for ConfigConstraints
impl Clone for ConfigConstraints
Source§fn clone(&self) -> ConfigConstraints
fn clone(&self) -> ConfigConstraints
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 ConfigConstraints
impl Debug for ConfigConstraints
Source§impl Default for ConfigConstraints
impl Default for ConfigConstraints
Source§fn default() -> ConfigConstraints
fn default() -> ConfigConstraints
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigConstraints
impl RefUnwindSafe for ConfigConstraints
impl Send for ConfigConstraints
impl Sync for ConfigConstraints
impl Unpin for ConfigConstraints
impl UnsafeUnpin for ConfigConstraints
impl UnwindSafe for ConfigConstraints
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