encode_to_vec

Function encode_to_vec 

Source
pub fn encode_to_vec<E, C>(val: E, config: C) -> Result<Vec<u8>, EncodeError>
where E: Serialize, C: Config,
Available on crate features serde and alloc only.
Expand description

Encode the given value into the given slice. Returns the amount of bytes that have been written.

See the config module for more information on configurations.

ยงErrors

Returns an EncodeError if the encoding fails.