#[non_exhaustive]
pub enum Error {
Show 49 variants Overflow(usize), Underflow(usize), InvalidDigit(usize), Empty(usize), EmptyMantissa(usize), EmptyExponent(usize), EmptyInteger(usize), EmptyFraction(usize), InvalidPositiveMantissaSign(usize), MissingMantissaSign(usize), InvalidExponent(usize), InvalidPositiveExponentSign(usize), MissingExponentSign(usize), ExponentWithoutFraction(usize), InvalidLeadingZeros(usize), MissingExponent(usize), MissingSign(usize), InvalidPositiveSign(usize), InvalidNegativeSign(usize), InvalidMantissaRadix, InvalidExponentBase, InvalidExponentRadix, InvalidDigitSeparator, InvalidDecimalPoint, InvalidExponentSymbol, InvalidBasePrefix, InvalidBaseSuffix, InvalidPunctuation, InvalidExponentFlags, InvalidMantissaSign, InvalidExponentSign, InvalidSpecial, InvalidConsecutiveIntegerDigitSeparator, InvalidConsecutiveFractionDigitSeparator, InvalidConsecutiveExponentDigitSeparator, InvalidFlags, InvalidNanString, NanStringTooLong, InvalidInfString, InfStringTooLong, InvalidInfinityString, InfinityStringTooLong, InfinityStringTooShort, InvalidFloatParseAlgorithm, InvalidRadix, InvalidFloatPrecision, InvalidNegativeExponentBreak, InvalidPositiveExponentBreak, Success,
}
Expand description

Error code during parsing, indicating failure type.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

Overflow(usize)

Integral overflow occurred during numeric parsing.

Underflow(usize)

Integral underflow occurred during numeric parsing.

InvalidDigit(usize)

Invalid digit found before string termination.

Empty(usize)

Empty byte array found.

EmptyMantissa(usize)

Empty mantissa found.

EmptyExponent(usize)

Empty exponent found.

EmptyInteger(usize)

Empty integer found.

EmptyFraction(usize)

Empty fraction found.

InvalidPositiveMantissaSign(usize)

Invalid positive mantissa sign was found.

MissingMantissaSign(usize)

Mantissa sign was required(usize), but not found.

InvalidExponent(usize)

Exponent was present but not allowed.

InvalidPositiveExponentSign(usize)

Invalid positive exponent sign was found.

MissingExponentSign(usize)

Exponent sign was required(usize), but not found.

ExponentWithoutFraction(usize)

Exponent was present without fraction component.

InvalidLeadingZeros(usize)

Integer or integer component of float had invalid leading zeros.

MissingExponent(usize)

No exponent with required exponent notation.

MissingSign(usize)

Integral sign was required(usize), but not found.

InvalidPositiveSign(usize)

Invalid positive sign for an integer was found.

InvalidNegativeSign(usize)

Invalid negative sign for an unsigned type was found.

InvalidMantissaRadix

Invalid radix for the mantissa (significant) digits.

InvalidExponentBase

Invalid base for the exponent.

InvalidExponentRadix

Invalid radix for the exponent digits.

InvalidDigitSeparator

Invalid digit separator character.

InvalidDecimalPoint

Invalid decimal point character.

InvalidExponentSymbol

Invalid symbol to represent exponent notation.

InvalidBasePrefix

Invalid character for a base prefix.

InvalidBaseSuffix

Invalid character for a base suffix.

InvalidPunctuation

Invalid punctuation characters: multiple symbols overlap.

InvalidExponentFlags

Optional exponent flags were set while disabling exponent notation.

InvalidMantissaSign

Set no positive mantissa sign while requiring mantissa signs.

InvalidExponentSign

Set no positive exponent sign while requiring exponent signs.

InvalidSpecial

Set optional special float flags while disable special floats.

InvalidConsecutiveIntegerDigitSeparator

Invalid consecutive integer digit separator.

InvalidConsecutiveFractionDigitSeparator

Invalid consecutive fraction digit separator.

InvalidConsecutiveExponentDigitSeparator

Invalid consecutive exponent digit separator.

InvalidFlags

Invalid flags were set without the format feature.

InvalidNanString

Invalid NaN string: must start with an n character.

NanStringTooLong

NaN string is too long.

InvalidInfString

Invalid short infinity string: must start with an i character.

InfStringTooLong

Short infinity string is too long.

InvalidInfinityString

Invalid long infinity string: must start with an i character.

InfinityStringTooLong

Long infinity string is too long.

InfinityStringTooShort

Long infinity string is too short: it must be as long as short infinity.

InvalidFloatParseAlgorithm

Invalid float parsing algorithm.

InvalidRadix

Invalid radix for the significant digits.

InvalidFloatPrecision

Invalid precision flags for writing floats.

InvalidNegativeExponentBreak

Invalid negative exponent break: break is above 0.

InvalidPositiveExponentBreak

Invalid positive exponent break: break is below 0.

Success

An error did not actually occur, and the result was successful.

Implementations

Get the index for the parsing error.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

const fn check to see if an error is of a specific type.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.