Expand description
This crate provides two traits: FromAscii which creates instances from ascii string (&[u8]) and FromAsciiRadix wich creates only integral values with given radix.
Usage example:
extern crate from_ascii;
use from_ascii::{FromAscii, FromAsciiRadix};
fn main() {
println!("{:?}", f64::from_ascii(b"123.456"));
println!("{:?}", i16::from_ascii_radix(b"FF", 16));
}Structs§
- Parse
Bool Error - An error returned when parsing a
boolfrom a ascii string fails. - Parse
Float Error - An error returned when parsing a floating value from a ascii string fails.
- Parse
IntError - An error returned when parsing a numeric value from a ascii string fails.
Traits§
- From
Ascii - A trait to abstract the idea of creating a new instance of a type from a ascii string.
- From
Ascii Radix - A trait to abstract the idea of creating a new instance of a numeric type from a ascii string with given radix.