Skip to main content

decode_value

Function decode_value 

Source
pub fn decode_value<T>(codec: &dyn Codec, payload: &[u8]) -> AppResult<T>
Expand description

Decode an already-read frame payload into T through codec.

Split from read_value so a caller that must inspect one frame as more than one shape can decode the same bytes without re-reading the stream.

ยงErrors

Returns a typed AppError (cause preserved) if the payload is not valid UTF-8 or does not decode into T.