Enum lexical_core::ErrorCode
source · [−]#[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
sourceimpl Ord for ErrorCode
impl Ord for ErrorCode
sourceimpl PartialOrd<ErrorCode> for ErrorCode
impl PartialOrd<ErrorCode> for ErrorCode
sourcefn partial_cmp(&self, other: &ErrorCode) -> Option<Ordering>
fn partial_cmp(&self, other: &ErrorCode) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralEq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more