junobuild_shared::serializers

Function deserialize_from_bytes

Source
pub fn deserialize_from_bytes<T: for<'a> Deserialize<'a>>(
    bytes: Cow<'_, [u8]>,
) -> T
Expand description

Deserializes a value from a byte array.

§Arguments

  • bytes - A Cow<'_, [u8]> representing the bytes to deserialize from.

§Returns

The deserialized value of type T.

§Panics

Panics if deserialization fails.