#ascii #parser

from-ascii

Traits which creates instances from ascii string

1 unstable release

Uses old Rust 2015

0.0.1 Jan 7, 2016

#245 in #ascii

Download history 21/week @ 2024-07-22 42/week @ 2024-07-29 22/week @ 2024-08-05 24/week @ 2024-08-12 32/week @ 2024-08-19 23/week @ 2024-08-26 29/week @ 2024-09-02 32/week @ 2024-09-09 24/week @ 2024-09-16 31/week @ 2024-09-23 27/week @ 2024-09-30 18/week @ 2024-10-07 21/week @ 2024-10-14 32/week @ 2024-10-21 46/week @ 2024-10-28 22/week @ 2024-11-04

122 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