[−][src]Trait catwalk::serialization::Serializer
(De)serializes Model
s in the form of a slice of u8
bytes.
When a Model
is serialized, it is serialized along with its version, via a StoredModel
struct.
Both the model itself and its version must be serialized and deserialized.
Required methods
pub fn to_bytes<M, R>(&self, model: &M) -> Result<R> where
M: Model,
R: AsRef<[u8]>,
[src]
M: Model,
R: AsRef<[u8]>,
Serializes a Model
and its version into bytes.
NOTE: The model's version must be serialized as part of the process.
pub fn from_bytes<M, R>(&self, bytes: R) -> Result<StoredModel<M>> where
M: Model,
R: AsRef<[u8]>,
[src]
M: Model,
R: AsRef<[u8]>,
Deserializes a Model
and its version from bytes.
NOTE: The model's version must be deserialized as part of the process.