float_format/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug, Clone, Copy, PartialEq, Eq, Hash)]
4pub enum Error {
5    #[error("insufficient bits to represent the exponent")]
6    InsufficientExponentBits,
7
8    #[error("insufficient bits to represent the mantissa")]
9    InsufficientMantissaBits,
10
11    #[error("mismatched format and value of the sign bit")]
12    MismatchedSignBit,
13
14    #[error("invalid or missing radix prefix")]
15    InvalidRadixPrefix,
16
17    #[error("insufficient bits to store the given bit pattern")]
18    InsufficientBitsForBitPattern,
19
20    #[error("invalid number string given for parsing")]
21    ParseStringError,
22
23    #[error("number string out of range for format")]
24    OutOfRange,
25
26    #[error("negative sign for unsigned format")]
27    NegativeSign,
28}