Skip to main content

serialize_to

Function serialize_to 

Source
pub fn serialize_to<B, T>(val: T) -> Result<B>
where B: Default + Write + AsRef<[u8]>, T: Serialize,
Expand description

Serializes a value into a default-constructed output buffer.

The buffer must support byte writes and expose its completed contents as a slice. The returned buffer retains any inline-storage behavior chosen by B.

ยง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.