Enum IntErrorKind Copy item path 1.55.0 · Source #[non_exhaustive]
pub enum IntErrorKind {
Empty,
InvalidDigit,
PosOverflow,
NegOverflow,
Zero,
NotAPowerOfTwo,
}This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Expand description Enum to store the various types of errors that can cause parsing or converting an
integer to fail.
§ Example
if let Err (e) = i32::from_str_radix("a12" , 10 ) {
println! ("Failed conversion to i32: {:?}" , e.kind());
}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.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Value being parsed is empty.
This variant will be constructed when parsing an empty string.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
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.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Integer is too large to store in target integer type.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Integer is too small to store in target integer type.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
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.
🔬 This is a nightly-only experimental API. (try_from_int_error_kind #153978 ) This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
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 .
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Performs copy-assignment from
source.
Read more This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Formats the value using the given formatter.
Read more This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Immutably borrows from an owned value.
Read more This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit #126799 ) This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Performs copy-assignment from
self to
dest.
Read more This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Returns the argument unchanged.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The type returned in the event of a conversion error.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Performs the conversion.
The type returned in the event of a conversion error.
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B) .
Performs the conversion.