Skip to main content

serialize_to_vec

Function serialize_to_vec 

Source
pub fn serialize_to_vec<T: Serialize>(val: T) -> Result<Vec<u8>>
Expand description

Serializes a value into an owned byte vector.

The database record codec determines the representation. Use Json or Cbor to delegate the wrapped payload to one of those formats.

ยงPanics

Panics if T requests a Serde data-model operation unsupported by this codec. Debug builds also panic when record-layout invariants are violated or when a directly wrapped Json<Box<serde_json::value::RawValue>> is serialized.