pub fn decode_strict<T>(input: &str) -> Result<T, ToonError>where
T: DeserializeOwned,Expand description
Decode with strict validation enabled (validates array lengths, indentation).
ยงExamples
use serde_json::{
json,
Value,
};
use toon_format::decode_strict;
// Valid array length
let result: Value = decode_strict("items[2]: a,b")?;
assert_eq!(result["items"], json!(["a", "b"]));
// Invalid array length (will error)
assert!(decode_strict::<Value>("items[3]: a,b").is_err());