Enum fixed_decimal::Error [−][src]
pub enum Error { Limit, Syntax, }
Variants
The magnitude or number of digits exceeds the limit of the FixedDecimal. The highest magnitude of the most significant digit is core::i16::MAX, and the lowest magnitude of the least significant digit is core::i16::MIN.
Examples
use fixed_decimal::FixedDecimal; use fixed_decimal::Error; let mut dec1 = FixedDecimal::from(123); assert_eq!(Error::Limit, dec1.multiply_pow10(core::i16::MAX).unwrap_err());
The input of a string that is supposed to be converted to FixedDecimal is not accepted.
Any string with non-digit characters (except for one ‘.’ and one ‘-’ at the beginning of the string) is not accepted. Also, empty string (“”) and its negation (“-”) are not accepted. Strings of form “12_345_678” are not accepted, the accepted format is “12345678”. Also ‘.’ shouldn’t be first or the last characters, i. e. .123 and 123. are not accepted, and instead 0.123 and 123 (or 123.0) must be used.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error