Enum lexical_parse_integer::Error
source · [−]#[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
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
sourceimpl Error
impl Error
sourcepub const fn is_overflow(&self) -> bool
pub const fn is_overflow(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_underflow(&self) -> bool
pub const fn is_underflow(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_digit(&self) -> bool
pub const fn is_invalid_digit(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_empty_mantissa(&self) -> bool
pub const fn is_empty_mantissa(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_empty_exponent(&self) -> bool
pub const fn is_empty_exponent(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_empty_integer(&self) -> bool
pub const fn is_empty_integer(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_empty_fraction(&self) -> bool
pub const fn is_empty_fraction(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_positive_mantissa_sign(&self) -> bool
pub const fn is_invalid_positive_mantissa_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_missing_mantissa_sign(&self) -> bool
pub const fn is_missing_mantissa_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_exponent(&self) -> bool
pub const fn is_invalid_exponent(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_positive_exponent_sign(&self) -> bool
pub const fn is_invalid_positive_exponent_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_missing_exponent_sign(&self) -> bool
pub const fn is_missing_exponent_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_exponent_without_fraction(&self) -> bool
pub const fn is_exponent_without_fraction(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_leading_zeros(&self) -> bool
pub const fn is_invalid_leading_zeros(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_missing_exponent(&self) -> bool
pub const fn is_missing_exponent(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_missing_sign(&self) -> bool
pub const fn is_missing_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_positive_sign(&self) -> bool
pub const fn is_invalid_positive_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_negative_sign(&self) -> bool
pub const fn is_invalid_negative_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_mantissa_radix(&self) -> bool
pub const fn is_invalid_mantissa_radix(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_exponent_base(&self) -> bool
pub const fn is_invalid_exponent_base(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_exponent_radix(&self) -> bool
pub const fn is_invalid_exponent_radix(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_digit_separator(&self) -> bool
pub const fn is_invalid_digit_separator(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_decimal_point(&self) -> bool
pub const fn is_invalid_decimal_point(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_exponent_symbol(&self) -> bool
pub const fn is_invalid_exponent_symbol(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_base_prefix(&self) -> bool
pub const fn is_invalid_base_prefix(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_base_suffix(&self) -> bool
pub const fn is_invalid_base_suffix(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_punctuation(&self) -> bool
pub const fn is_invalid_punctuation(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_exponent_flags(&self) -> bool
pub const fn is_invalid_exponent_flags(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_mantissa_sign(&self) -> bool
pub const fn is_invalid_mantissa_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_exponent_sign(&self) -> bool
pub const fn is_invalid_exponent_sign(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_special(&self) -> bool
pub const fn is_invalid_special(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_consecutive_integer_digit_separator(&self) -> bool
pub const fn is_invalid_consecutive_integer_digit_separator(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_consecutive_fraction_digit_separator(&self) -> bool
pub const fn is_invalid_consecutive_fraction_digit_separator(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_consecutive_exponent_digit_separator(&self) -> bool
pub const fn is_invalid_consecutive_exponent_digit_separator(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_flags(&self) -> bool
pub const fn is_invalid_flags(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_nan_string(&self) -> bool
pub const fn is_invalid_nan_string(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_nan_string_too_long(&self) -> bool
pub const fn is_nan_string_too_long(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_inf_string(&self) -> bool
pub const fn is_invalid_inf_string(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_inf_string_too_long(&self) -> bool
pub const fn is_inf_string_too_long(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_infinity_string(&self) -> bool
pub const fn is_invalid_infinity_string(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_infinity_string_too_long(&self) -> bool
pub const fn is_infinity_string_too_long(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_infinity_string_too_short(&self) -> bool
pub const fn is_infinity_string_too_short(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_float_parse_algorithm(&self) -> bool
pub const fn is_invalid_float_parse_algorithm(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_radix(&self) -> bool
pub const fn is_invalid_radix(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_float_precision(&self) -> bool
pub const fn is_invalid_float_precision(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_negative_exponent_break(&self) -> bool
pub const fn is_invalid_negative_exponent_break(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_invalid_positive_exponent_break(&self) -> bool
pub const fn is_invalid_positive_exponent_break(&self) -> bool
const fn check to see if an error is of a specific type.
sourcepub const fn is_success(&self) -> bool
pub const fn is_success(&self) -> bool
const fn check to see if an error is of a specific type.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl Ord for Error
impl Ord for Error
sourceimpl PartialOrd<Error> for Error
impl PartialOrd<Error> for Error
sourcefn partial_cmp(&self, other: &Error) -> Option<Ordering>
fn partial_cmp(&self, other: &Error) -> 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 Error
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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