#[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 (const: unstable) ยท Sourceยงfn clone_from(&mut self, source: &Self)where
Self:,
fn clone_from(&mut self, source: &Self)where
Self:,
source. Read moreimpl Copy for IntErrorKind
1.55.0 ยท Sourceยงimpl Debug for IntErrorKind
impl Debug for IntErrorKind
impl Eq for IntErrorKind
1.55.0 ยท Sourceยงimpl Hash for IntErrorKind
impl Hash for IntErrorKind
1.55.0 ยท Sourceยงimpl PartialEq for IntErrorKind
impl PartialEq for IntErrorKind
Sourceยงfn eq(&self, other: &IntErrorKind) -> bool
fn eq(&self, other: &IntErrorKind) -> bool
self and other values to be equal, and is used by ==.