Skip to main content

encode_to_vec

Function encode_to_vec 

Source
pub fn encode_to_vec<E: Encode>(value: &E) -> Result<Vec<u8>>
Available on crate feature alloc only.
Expand description

Encode a value to a Vec<u8> using the standard configuration.

ยงExamples

let bytes = oxicode::encode_to_vec(&42u32).expect("encode failed");
assert!(!bytes.is_empty());