Manual `serde` implementations
Currently, serde::Serialize
and Deserialize
are derived automatically. However, for some data structures, this is not the best representation. Also, due to the lack of validation, it means that invalid structures can be deserialized without errors. For example, we can deserialize a "tree" with cycles, or a graph edge pointing to a non-existent node.
We'd like to have a manual implementation for serde
traits where it makes sense. Ideally, the serialized format would be similar to the data structure (e.g. a tree would serialize as a tree). Deserialization should fail if the data is invalid.