#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

#57 in #ascii

Download history 15/week @ 2021-06-25 8/week @ 2021-07-02 9/week @ 2021-07-09 6/week @ 2021-07-16 7/week @ 2021-07-23 9/week @ 2021-07-30 53/week @ 2021-08-06 6/week @ 2021-08-13 29/week @ 2021-08-20 1/week @ 2021-08-27 3/week @ 2021-09-03 12/week @ 2021-09-10 6/week @ 2021-09-17 8/week @ 2021-09-24 10/week @ 2021-10-01 10/week @ 2021-10-08

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