Serialization/deserialization for Rust