#Use `bincode` to parse json formatted data into bytes and back

3 messages · Page 1 of 1 (latest)

deft crater
#

I am building a small crate that stores data inside a file and loads it (with some encryption), my goal is to pass some data without specified format (like serde_json::Value) store and load it, but id doesn't work as i get the error Serde(AnyNotSupported). Is it there another way to do it? It already supports datatypes that implement serde or bincode::{Encode, Decode}. I need it to work with Value as i want to use it to take python dictionnaries and parse them into Value using pyo3, if it's not possible i will simply parse the Value to a string and use serde_json::from / to _str but i want the most compact format possible, thanks

open mirage
#

bincode is not self describing, if you want a self describing format like Json I would recommend looking at message pack