pub enum InvalidValueReason {
BlankRejected,
InvalidSyntax {
expected: &'static str,
},
OutOfRange,
PrecisionLoss,
NonFinite,
InvalidBoolean,
NegativeDuration,
UnsupportedDurationUnit,
Serialization {
format: DataFormat,
},
Deserialization {
format: DataFormat,
},
}Expand description
Stable reason an otherwise supported conversion rejected its source value.
Reasons contain only structural context such as an expected grammar or data format. They never contain the original source value. This keeps matching predictable for callers and avoids accidental disclosure in logs.
Variants§
BlankRejected
A blank string is forbidden by the active policy.
InvalidSyntax
The source text does not match the target syntax.
OutOfRange
The source value is outside the target range.
PrecisionLoss
An exact conversion would lose information.
NonFinite
A non-finite floating-point value is not accepted.
InvalidBoolean
The value is invalid under the active boolean policy.
NegativeDuration
A negative value cannot represent a duration.
UnsupportedDurationUnit
The duration suffix is not supported.
Serialization
Serialization to a structured format failed.
Fields
format: DataFormatFormat whose serialization failed.
Deserialization
Deserialization from a structured format failed.
Fields
format: DataFormatFormat whose deserialization failed.
Trait Implementations§
Source§impl Clone for InvalidValueReason
impl Clone for InvalidValueReason
Source§fn clone(&self) -> InvalidValueReason
fn clone(&self) -> InvalidValueReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InvalidValueReason
impl Debug for InvalidValueReason
Source§impl Display for InvalidValueReason
impl Display for InvalidValueReason
impl Eq for InvalidValueReason
Source§impl Error for InvalidValueReason
impl Error for InvalidValueReason
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()