junobuild_shared::serializers

Function serialize_to_bytes

Source
pub fn serialize_to_bytes<T: Serialize>(value: &T) -> Cow<'_, [u8]>
Expand description

Serializes a given value into a byte array.

§Arguments

  • value - A reference to the value to serialize.

§Returns

A Cow<[u8]> representing the serialized data.

§Panics

Panics if serialization fails.