10 ms·
Not clear on the problem. In Rust, each struct type, to be serialized, must have a serialization and deserialization function of its own. There's a macro to ge
by Animats 2y ago
Not clear on the problem.
In Rust, each struct type, to be serialized, must have a serialization and deserialization function of its own. There's a macro to generate these by calling the appropriate serialization or deserialization function for each field.
For the common types, there's a set of standard serialize and deserialize functions. Here's the list.[1] Those handle the special cases around Vec, Mutex, and such.
The author doesn't make a strong case for reflection for other purposes.
[1] https://docs.rs/serde/latest/serde/trait.Serialize.html https://docs.rs/serde/latest/serde/trait.Serialize.html