Crates.io | json_flex |
lib.rs | json_flex |
version | 0.3.3 |
source | src |
created_at | 2015-12-06 18:10:52.955235 |
updated_at | 2020-03-14 09:08:51.037538 |
description | Flexibly Parse a JSON string |
homepage | http://nacika.com |
repository | https://github.com/nacika-ins/json_flex |
max_upload_size | |
id | 3579 |
size | 104,406 |
Flexibly Parse a JSON string
Add this to your Cargo.toml
:
[dependencies]
json_flex = "*"
and this to your crate root:
extern crate json_flex;
use json_flex::{JFObject, Unwrap};
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());
}
JsonFlex is released under the MIT License.