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.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.