Struct compacto::Decompressor [−][src]
pub struct Decompressor { /* fields omitted */ }Implementations
Construct a new Decompressor using a serde::Value and default values
Example
let json = serde_json::from_str(r#"[{"0":1,"1": 0},["a","b"]]"#).unwrap();
let mut compacto = compacto::Decompressor::new(json);
println!("{:?}", compacto.decompress());Construct a new Decompressor using a a JSON string and default values
Example
let mut compacto = compacto::Decompressor::new_from_str(r#"[{"0":1,"1": 0},["a","b"]]"#).unwrap();
println!("{:?}", compacto.decompress());Decompress JSON
decompress will first check if the input is an array and its length is equal to two.
If it does not match the “criteria to decompress,” the original input will be returned.
If the input matches the criteria, we rebuilt the JSON using the reference table.