Skip to main content

encode

Function encode 

Source
pub fn encode<T: Encode>(buf: &mut [u8], value: T) -> Result<usize>
Expand description

Encodes a value into a slice, returning the encoded length.

Unlike the array-based functions, the buffer only needs room for the value’s actual encoded size, not the type’s maximum.