pub fn slice_to_deserialize<'a, T>(view: &'a [u8]) -> Result<T, Error>
where T: Deserialize<'a>,
Expand description

A function for the custom protocol handler to deserialize a &[u8] into a type implementing serde::Deserialize.

This function exists to allow the custom protocol handler to deserialize the accepted body of a request into the type representing the command’s arguments (a tuple of some arity) so that the command-function can be called on the deserialized arguments.