1 unstable release

Uses old Rust 2015

0.0.1 Jan 7, 2016

#52 in #ascii

Download history 13/week @ 2021-01-12 14/week @ 2021-01-19 13/week @ 2021-01-26 6/week @ 2021-02-02 8/week @ 2021-02-09 21/week @ 2021-02-16 106/week @ 2021-02-23 16/week @ 2021-03-02 88/week @ 2021-03-09 22/week @ 2021-03-16 25/week @ 2021-03-23 9/week @ 2021-03-30 9/week @ 2021-04-06 14/week @ 2021-04-13 15/week @ 2021-04-20 12/week @ 2021-04-27

78 downloads per month
Used in 2 crates (via twsapi)

MIT license

13KB
266 lines

from-ascii Build Status

This crate provides two traits: FromAscii which creates instances from ascii string (&[u8]) and FromAsciiRadix wich creates only integral values with given radix.

The documentation is located at http://knsd.github.io/from-ascii/.

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));
}


lib.rs:

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));
}

No runtime deps