#ascii #numeric #parser

from-ascii

Traits which creates instances from ascii string

1 unstable release

Uses old Rust 2015

0.0.1 Jan 7, 2016

#229 in #numeric

Download history 115/week @ 2024-11-23 41/week @ 2024-11-30 41/week @ 2024-12-07 45/week @ 2024-12-14 5/week @ 2024-12-21 13/week @ 2024-12-28 25/week @ 2025-01-04 32/week @ 2025-01-11 22/week @ 2025-01-18 26/week @ 2025-01-25 42/week @ 2025-02-01 101/week @ 2025-02-08 49/week @ 2025-02-15 33/week @ 2025-02-22 33/week @ 2025-03-01 113/week @ 2025-03-08

232 downloads per month
Used in 3 crates (2 directly)

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