Struct rug::integer::TryFromIntegerError
source · [−]pub struct TryFromIntegerError { /* private fields */ }
Expand description
An error which can be returned when a checked conversion from Integer
fails.
Examples
use core::convert::TryFrom;
use rug::{integer::TryFromIntegerError, Integer};
// This is negative and cannot be converted to u32.
let i = Integer::from(-5);
let error: TryFromIntegerError = match u32::try_from(&i) {
Ok(_) => unreachable!(),
Err(error) => error,
};
println!("Error: {}", error);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TryFromIntegerError
impl Send for TryFromIntegerError
impl Sync for TryFromIntegerError
impl Unpin for TryFromIntegerError
impl UnwindSafe for TryFromIntegerError
Blanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Casts the value.
Casts the value.
OverflowingCasts the value.
Casts the value.
Casts the value.
Casts the value.
UnwrappedCasts the value.
Casts the value.
WrappingCasts the value.