#ascii #parser #parsing #numerics

from-ascii

Traits which creates instances from ascii string

1 unstable release

Uses old Rust 2015

0.0.1 Jan 7, 2016

#54 in #ascii

Download history 6/week @ 2021-04-04 12/week @ 2021-04-11 17/week @ 2021-04-18 14/week @ 2021-04-25 9/week @ 2021-05-02 11/week @ 2021-05-09 68/week @ 2021-05-16 18/week @ 2021-05-23 45/week @ 2021-05-30 13/week @ 2021-06-06 51/week @ 2021-06-13 6/week @ 2021-06-20 13/week @ 2021-06-27 8/week @ 2021-07-04 9/week @ 2021-07-11 8/week @ 2021-07-18

118 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