Struct rug::rational::TryFromFloatError [−][src]
pub struct TryFromFloatError { /* fields omitted */ }
An error which can be returned when a checked conversion from a
floating-point number to a Rational
number fails.
Examples
use rug::rational::TryFromFloatError; use rug::Rational; use std::convert::TryFrom; // This is not finite and cannot be converted to Rational. let inf = 1.0f32 / 0.0; let error: TryFromFloatError = match Rational::try_from(inf) { Ok(_) => unreachable!(), Err(error) => error, }; println!("Error: {}", error);
Trait Implementations
impl Error for TryFromFloatError
[src]
impl Error for TryFromFloatError
fn description(&self) -> &str
[src]
fn description(&self) -> &str
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&Error>
1.0.0[src]
fn cause(&self) -> Option<&Error>
1.0.0
[src]The lower-level cause of this error, if any. Read more
impl Display for TryFromFloatError
[src]
impl Display for TryFromFloatError
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for TryFromFloatError
[src]
impl Clone for TryFromFloatError
fn clone(&self) -> TryFromFloatError
[src]
fn clone(&self) -> TryFromFloatError
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for TryFromFloatError
[src]
impl Copy for TryFromFloatError
impl Debug for TryFromFloatError
[src]
impl Debug for TryFromFloatError
Auto Trait Implementations
impl Send for TryFromFloatError
impl Send for TryFromFloatError
impl Sync for TryFromFloatError
impl Sync for TryFromFloatError