Function try_from_str
Source pub fn try_from_str<T>(
val: &str,
) -> Result<Ratio<T>, FromStrErr<<T as FromStr>::Err>>where
T: Clone + From<u8> + FromStr +
Integer + for<'a> Mul<&'a T, Output = T> +
Pow<usize, Output = T>,
Expand description
Converts a string in rational or decimal notation into a Ratio<T>.
§Panics
May panic if T implements arithmetic in a way where panics occur on overflow or underflow.
§Errors
Will return FromStrErr iff val is not a rational number in
rational or decimal notation.