Function parse

Source
pub fn parse(source: &str) -> Result<JsonItem, JsonError>
Expand description

Main library function. Parses JSON data.

§Arguments

  • source - Text content to be parsed

§Example

fn main() {
   let json = "{\"jsonic\": \"Fast, small JSON parsing library for rust with no dependencies\"}";

   match jsonic::parse(json) {
       Ok(parsed) => { println!("Describe jsonic? {:?}", parsed["jsonic"].as_str()); }
       Err(error) => { eprintln!("{}", error); }
   }
}