Whilst digging through the source of the Kata Containers project, specifically the kata-agent and kata-agent-ctl code, both of which are written in Rust, I kept coming across references to serde ...
e.g. from utils.rs
let oci_spec = ociSpec::load(&spec_file).map_err(|e| anyhow!(e))?;
serde_json::to_string(&oci_spec).map_err(|e| anyhow!(e))
}
Having first assumed that this was some shorthand, I dug further and found this: -
Serde is a framework for serializing and deserializing Rust data structures efficiently and generically.
Serialization framework for Rust
Having used serialisation and deserialisation in Java back in the day, this made sense....
Serialization is a mechanism of converting the state of an object into a byte stream. Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory. This mechanism is used to persist the object.
Serialization and Deserialization in Java with Example
So now I know ....
No comments:
Post a Comment