Enum lexical_core::ErrorCode [−][src]
#[repr(i32)]
pub enum ErrorCode {
Show 15 variants
Overflow,
Underflow,
InvalidDigit,
Empty,
EmptyMantissa,
EmptyExponent,
EmptyInteger,
EmptyFraction,
InvalidPositiveMantissaSign,
MissingMantissaSign,
InvalidExponent,
InvalidPositiveExponentSign,
MissingExponentSign,
ExponentWithoutFraction,
InvalidLeadingZeros,
// some variants omitted
}
Expand description
Error code, indicating failure type.
Error messages are designating by an error code of less than 0. This is to be compatible with C conventions. This enumeration is FFI-compatible for interfacing with C code.
FFI
For interfacing with FFI-code, this may be approximated by:
const int32_t OVERFLOW = -1;
const int32_t UNDERFLOW = -2;
const int32_t INVALID_DIGIT = -3;
const int32_t EMPTY = -4;
const int32_t EMPTY_FRACTION = -5;
const int32_t EMPTY_EXPONENT = -6;
Safety
Assigning any value outside the range [-6, -1]
to value of type
ErrorCode may invoke undefined-behavior.
Variants
Integral overflow occurred during numeric parsing.
Numeric overflow takes precedence over the presence of an invalid digit.
Integral underflow occurred during numeric parsing.
Numeric overflow takes precedence over the presence of an invalid digit.
Invalid digit found before string termination.
Empty byte array found.
Empty mantissa found.
Empty exponent found.
Empty integer found.
Empty fraction found.
Invalid positive mantissa sign was found.
Mantissa sign was required, but not found.
Exponent was present but not allowed.
Invalid positive exponent sign was found.
Exponent sign was required, but not found.
Exponent was present without fraction component.
Integer had invalid leading zeros.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations
Mutably borrows from an owned value. Read more