pub fn json_cast<N, M>(params: N) -> Result<M, Error>where
N: Serialize,
M: DeserializeOwned,Expand description
Cast from N to M by serializing/deserialization to/from JSON.
Use this for values the SDK or your own code produced, such as response
results. Use json_cast_params for incoming request or notification params.
ยงErrors
Returns Parse error (-32700) if serialization or deserialization fails.
Returned diagnostics can contain the input JSON and payload-bearing parse
reasons. Treat them as sensitive, as with json_cast_params.