Skip to main content

to_vec

Function to_vec 

Source
pub fn to_vec<T: ToJson + ?Sized>(value: &T) -> Result<Vec<u8>, Error>
Expand description

Serialize value into a fresh Vec<u8>.

This is the primary fast path: writes directly into Vec<u8> via ByteSink, bypassing String’s per-write UTF-8 invariant checks.