Enum lexical_core::ErrorCode[][src]

#[repr(i32)]
pub enum ErrorCode {
Show variants Overflow, Underflow, InvalidDigit, Empty, EmptyMantissa, EmptyExponent, EmptyInteger, EmptyFraction, InvalidPositiveMantissaSign, MissingMantissaSign, InvalidExponent, InvalidPositiveExponentSign, MissingExponentSign, ExponentWithoutFraction, InvalidLeadingZeros, // some variants omitted
}

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

impl Clone for ErrorCode[src]

impl Copy for ErrorCode[src]

impl Debug for ErrorCode[src]

impl Eq for ErrorCode[src]

impl From<ErrorCode> for Error[src]

impl Ord for ErrorCode[src]

impl PartialEq<ErrorCode> for ErrorCode[src]

impl PartialOrd<ErrorCode> for ErrorCode[src]

impl StructuralEq for ErrorCode[src]

impl StructuralPartialEq for ErrorCode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.