-
Notifications
You must be signed in to change notification settings - Fork 186
Description
Serialization is a handy tool for some use cases, for example it could be used to save Events to a file, and replay them later. Serde is the Rust ecosystem's most popular library for data serialization. To implement serialization, all you need to do is #[derive(Serialize, Deserialize)] on the structs and enums in rdev.rs. The user can then choose a serialization format - JSON is popular, but serde maintains a lengthy list of supported formats. Of course this requires rdev to depend on serde, but it can be an optional feature (so disabled by default). Having an optional serde feature is fairly common, for example most of the most downloaded (according to lib.rs) data-structures crates have such a dependency (I realize this is not a data structure crate).