Enum lexical::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
Overflow
Integral overflow occurred during numeric parsing.
Numeric overflow takes precedence over the presence of an invalid digit.
Underflow
Integral underflow occurred during numeric parsing.
Numeric overflow takes precedence over the presence of an invalid digit.
InvalidDigit
Invalid digit found before string termination.
Empty
Empty byte array found.
EmptyMantissa
Empty mantissa found.
EmptyExponent
Empty exponent found.
EmptyInteger
Empty integer found.
EmptyFraction
Empty fraction found.
InvalidPositiveMantissaSign
Invalid positive mantissa sign was found.
MissingMantissaSign
Mantissa sign was required, but not found.
InvalidExponent
Exponent was present but not allowed.
InvalidPositiveExponentSign
Invalid positive exponent sign was found.
MissingExponentSign
Exponent sign was required, but not found.
ExponentWithoutFraction
Exponent was present without fraction component.
InvalidLeadingZeros
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