pub struct ConversionConfig {
pub lookup_tables_variant: LookupVariant,
pub fraction_strategy: FractionStrategy,
pub rounding_strategy: RoundingStrategy,
}Expand description
Configuration for conversion functions.
Fields§
§lookup_tables_variant: LookupVariantUse lookup tables first for conversion, then fallback to regular computations Note: When using lookup tables feature, conversion from 1.67 or -150 gives 4/6 instead of 2/3 (see README.md)
fraction_strategy: FractionStrategyFractions computing strategy
rounding_strategy: RoundingStrategyRounding method for Decimal type
Implementations§
Source§impl ConversionConfig
impl ConversionConfig
pub fn no_lookup(self) -> Self
pub fn extended_lookup(self) -> Self
pub fn plain_fraction_strategy(self) -> Self
pub fn fraction_strategy(self, strategy: FractionStrategy) -> Self
pub fn rounding_strategy(self, strategy: RoundingStrategy) -> Self
Trait Implementations§
Source§impl Clone for ConversionConfig
impl Clone for ConversionConfig
Source§fn clone(&self) -> ConversionConfig
fn clone(&self) -> ConversionConfig
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 ConversionConfig
impl Debug for ConversionConfig
Source§impl Default for ConversionConfig
impl Default for ConversionConfig
impl Copy for ConversionConfig
Auto Trait Implementations§
impl Freeze for ConversionConfig
impl RefUnwindSafe for ConversionConfig
impl Send for ConversionConfig
impl Sync for ConversionConfig
impl Unpin for ConversionConfig
impl UnwindSafe for ConversionConfig
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