pub fn to_bytes<T: Serialize>(value: &T) -> Result<Vec<u8>, Error>
Expand description
The function to serialize data of a given type to a byte vector. The
value
must implement the Serialize
trait from the serde
library. It returns
a Result with the serialized byte vector or an error.