serialize

Function serialize 

Source
pub fn serialize<T: Serialize>(data: &T) -> Result<Vec<u8>, Error>
Expand description

Serializes a data structure into a Vec using CBOR format.

§Arguments

  • data - A reference to the data to be serialized.

§Returns

  • Result<Vec<u8>, Error> - The serialized data as a vector of bytes, or an error if serialization fails.