pub struct ParseIntError { /* private fields */ }
An error which can be returned when parsing an integer.
For example, this error is returned by the from_str_radix() functions on the primitive integer types (such as i8::from_str_radix) and is used as the error type in their FromStr implementations.
Among other causes, ParseIntError can be thrown because of leading or trailing whitespace in the string e.g., when it is obtained from the standard input. Using the str::trim() method ensures that no whitespace remains before parsing.
if let Err(e) = i32::from_str_radix("a12", 10) {
println!("Failed conversion to i32: {e}");
}impl ParseIntError
pub const fn kind(&self) -> &IntErrorKind
Outputs the detailed cause of parsing an integer failing.
impl Clone for ParseIntError
fn clone(&self) -> ParseIntError
fn clone_from(&mut self, source: &Self)
source. Read more
impl Debug for ParseIntError
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
impl Display for ParseIntError
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
impl Error for ParseIntError
fn source(&self) -> Option<&(dyn Error + 'static)>
fn description(&self) -> &str
fn cause(&self) -> Option<&dyn Error>
fn provide<'a>(&'a self, request: &mut Request<'a>)
error_generic_member_access #99301)
impl PartialEq for ParseIntError
fn eq(&self, other: &ParseIntError) -> bool
self and other values to be equal, and is used by ==.fn ne(&self, other: &Rhs) -> bool
!=. The default implementation is almost always sufficient, and should not be overridden without very good reason.impl Eq for ParseIntError
impl StructuralPartialEq for ParseIntError
impl Freeze for ParseIntError
impl RefUnwindSafe for ParseIntError
impl Send for ParseIntError
impl Sync for ParseIntError
impl Unpin for ParseIntError
impl UnwindSafe for ParseIntError
impl<T> Any for Twhere
T: 'static + ?Sized,impl<T> Borrow<T> for Twhere
T: ?Sized,impl<T> BorrowMut<T> for Twhere
T: ?Sized,impl<T> CloneToUninit for Twhere
T: Clone,unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit #126799)
impl<T> From<T> for T
fn from(t: T) -> T
Returns the argument unchanged.
impl<T, U> Into<U> for Twhere
U: From<T>,fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of From<T> for U chooses to do.
impl<T> ToOwned for Twhere
T: Clone,type Owned = T
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)
impl<T> ToString for Twhere
T: Display + ?Sized,impl<T, U> TryFrom<U> for Twhere
U: Into<T>,type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/num/struct.ParseIntError.html