Skip to main content

encode

Function encode 

Source
pub fn encode<T>(codec: &dyn Codec, value: &T) -> AppResult<String>
where T: Serialize + ?Sized,
Expand description

Encode any Serialize value using codec.

The value is first converted to the canonical Value tree, then encoded.

ยงErrors

Returns a typed AppError (cause preserved) when the value cannot be converted to the value model or encoded by codec.