Struct wasmtime_environ::__core::num::ParseIntError
1.0.0 · source · [−]pub struct ParseIntError { /* private fields */ }
Expand description
An error which can be returned when parsing an integer.
This error is used as the error type for the from_str_radix()
functions
on the primitive integer types, such as i8::from_str_radix
.
Potential causes
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.
Example
if let Err(e) = i32::from_str_radix("a12", 10) {
println!("Failed conversion to i32: {e}");
}
Implementations
sourceimpl ParseIntError
impl ParseIntError
1.55.0 · sourcepub fn kind(&self) -> &IntErrorKind
pub fn kind(&self) -> &IntErrorKind
Outputs the detailed cause of parsing an integer failing.
Trait Implementations
sourceimpl Clone for ParseIntError
impl Clone for ParseIntError
sourcefn clone(&self) -> ParseIntError
fn clone(&self) -> ParseIntError
Returns a copy of the value. Read more
sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ParseIntError
impl Debug for ParseIntError
sourceimpl Display for ParseIntError
impl Display for ParseIntError
sourceimpl Error for ParseIntError
impl Error for ParseIntError
sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
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
sourceimpl PartialEq<ParseIntError> for ParseIntError
impl PartialEq<ParseIntError> for ParseIntError
sourcefn eq(&self, other: &ParseIntError) -> bool
fn eq(&self, other: &ParseIntError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ParseIntError) -> bool
fn ne(&self, other: &ParseIntError) -> bool
This method tests for !=
.
impl Eq for ParseIntError
impl StructuralEq for ParseIntError
impl StructuralPartialEq for ParseIntError
Auto Trait Implementations
impl RefUnwindSafe for ParseIntError
impl Send for ParseIntError
impl Sync for ParseIntError
impl Unpin for ParseIntError
impl UnwindSafe for ParseIntError
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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more