6 releases

Uses old Rust 2015

0.3.3 Mar 14, 2020
0.3.2 Dec 23, 2015
0.2.0 Dec 9, 2015
0.1.0 Dec 6, 2015

#8 in #flex


Used in 3 crates

MIT license

105KB
2K SLoC

JsonFlex Build Status

Flexibly Parse a JSON string

Usage

Add this to your Cargo.toml:

[dependencies]
json_flex = "*"

and this to your crate root:

extern crate json_flex;
use json_flex::{JFObject, Unwrap};

Example

extern crate json_flex;
#[warn(unused_imports)]
use json_flex::{JFObject, Unwrap};

fn main() {
    let array = json_flex::decode(r#"[1,2,3,4]"#.to_owned());
    println!("{:?}", array);
    println!("{:?}", array.to_json());

    let array = json_flex::decode(r#"["1","2","3","4"]"#.to_owned());
    println!("{:?}", array[0].into_string());
    println!("{:?}", array.to_json());
}

License

JsonFlex is released under the MIT License.

Dependencies

~225KB