pub fn decode<T>(codec: &dyn Codec, contents: &str) -> AppResult<T>where
T: DeserializeOwned,Expand description
Decode text into any DeserializeOwned type using codec.
The text is decoded to the canonical Value tree, then deserialized into
T. This honors #[serde(deny_unknown_fields)] on T.
ยงErrors
Returns a typed AppError (cause preserved) when contents is malformed
or does not match T (including unknown fields under
deny_unknown_fields).