Crate from_ascii [] [src]

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

ParseBoolError

An error returned when parsing a bool from a ascii string fails.

ParseFloatError

An error returned when parsing a floating value from a ascii string fails.

ParseIntError

An error returned when parsing a numeric value from a ascii string fails.

Traits

FromAscii

A trait to abstract the idea of creating a new instance of a type from a ascii string.

FromAsciiRadix

A trait to abstract the idea of creating a new instance of a numeric type from a ascii string with given radix.