Struct rug::rational::ValidRational
[−]
[src]
pub struct ValidRational<'a> { /* fields omitted */ }
A validated string that can always be converted to a Rational
.
See the Rational::valid_str_radix
method.
Examples
use rug::Rational; use rug::rational::ValidRational; // This string is correct in radix 10, it cannot fail. let s = "123/456"; let valid: ValidRational = match Rational::valid_str_radix(s, 10) { Ok(valid) => valid, Err(_) => unreachable!(), }; let r = Rational::from(valid); assert_eq!(r, (123, 456));
Trait Implementations
impl<'a> Clone for ValidRational<'a>
[src]
fn clone(&self) -> ValidRational<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more