decode

Function decode 

Source
pub fn decode(input: &str, options: &DecodeOptions) -> ToonResult<Value>
Expand description

Decode a TOON string to a JSON value with custom options.

ยงExamples

use serde_json::json;
use toon_format::{
    decode,
    DecodeOptions,
    Delimiter,
};

let input = "name: Alice\nage: 30";
let options = DecodeOptions::new().with_strict(false);
let result = decode(input, &options)?;
assert_eq!(result["name"], json!("Alice"));