Function serialize
Source pub fn serialize<T: ToBytes>(value: &T) -> Bytes
Expand description
Serializes a value implementing the ToBytes trait into a Bytes object.
§Arguments
value - The value to be serialized.
§Returns
Returns a Bytes object containing the serialized representation of the value.
§Panics
Panics if serialization fails.