Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.
/ serde_multi Public archive

Standardized trait API for `serde`-based crates and dynamic serialization/deserialization.

License

Notifications You must be signed in to change notification settings

ScottyThePilot/serde_multi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serde Multi

Crate API

Note: This is deprecated in favor of erased-serde

This library exposes a standardized API across a number of file formats, as well as providing traits to make it possible to dynamically choose file serialization/deserialization format at runtime or based on generics.

Each file format is toggled via feature, all of which are disabled by default.

Currently the only supported file formats are:

If you would like to add more file formats, feel free to make a pull request.

Example Usage

use serde_multi::{SerdeText, Error};
use serde_multi::formats::json::Json;
use std::collections::HashMap;

let mut value: HashMap<String, i32> = HashMap::new();
value.insert("foo".to_owned(), -193);
value.insert("bar".to_owned(), 3058);

// `Json` can be swapped out for any value that implements `SerdeText` here.
let s = Json.to_string(&value).expect("failed to serialize");
println!("serialized: {}", s);

About

Standardized trait API for `serde`-based crates and dynamic serialization/deserialization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages