pub enum NumericConversionPolicy {
Exact,
Lossy,
}Expand description
Controls whether numeric conversions must preserve the source value.
Self::Exact rejects fractional truncation, integer-to-float rounding,
and duration unit remainders. Self::Lossy permits the documented
conversion for each target family but still rejects non-finite or
out-of-range results where no target value exists.
Variants§
Exact
Reject conversions that require truncation, rounding, or precision loss.
Lossy
Permit the explicitly documented lossy conversion behavior.
Implementations§
Source§impl NumericConversionPolicy
impl NumericConversionPolicy
Sourcepub const fn env_friendly() -> Self
pub const fn env_friendly() -> Self
Returns the numeric policy used for environment-variable input.
Environment variables are textual, but that does not imply permission to truncate or round their numeric values. The profile therefore uses exact conversion today while keeping that decision local to this type.
§Returns
The numeric conversion policy for environment-variable values.
Trait Implementations§
Source§impl Clone for NumericConversionPolicy
impl Clone for NumericConversionPolicy
Source§fn clone(&self) -> NumericConversionPolicy
fn clone(&self) -> NumericConversionPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more