Function encode
Source pub fn encode<T>(codec: &dyn Codec, value: &T) -> AppResult<String>
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.