Skip to main content

decode_from_slice

Function decode_from_slice 

Source
pub fn decode_from_slice<T: Decodable>(
    bytes: &[u8],
) -> Result<T, DecodeError<<T::Decoder as Decoder>::Error>>
Expand description

Decodes an object from a byte slice.

ยงErrors

Returns an error if the decoder encounters an error while parsing the data, including insufficient data. This function also errors if the provided slice is not completely consumed during decode.