#[non_exhaustive]pub enum IntErrorKind {
Empty,
InvalidDigit,
PosOverflow,
NegOverflow,
Zero,
NotAPowerOfTwo,
}Expand description
Enum to store the various types of errors that can cause parsing or converting an integer to fail.
§Example
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
Value being parsed is empty.
This variant will be constructed when parsing an empty string.
InvalidDigit
Contains an invalid digit in its context.
Among other causes, this variant will be constructed when parsing a string that contains a non-ASCII char.
This variant is also constructed when a + or - is misplaced within a string
either on its own or in the middle of a number.
PosOverflow
Integer is too large to store in target integer type.
NegOverflow
Integer is too small to store in target integer type.
Zero
Value was Zero
This variant will be emitted when the parsing string or the converting integer has a value of zero, which would be illegal for non-zero types.
NotAPowerOfTwo
try_from_int_error_kind #153978)Value is not a power of two.
This variant will be emitted when converting an integer that is not a power of
two. This is required in some cases such as constructing an Alignment.
Trait Implementations§
1.55.0 · Source§impl Clone for IntErrorKind
impl Clone for IntErrorKind
Source§fn clone(&self) -> IntErrorKind
fn clone(&self) -> IntErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more