pub fn decode_from_slice<T, C>(
    slice: &[u8],
    config: C
) -> Result<(T, usize), DecodeError>where
    T: DeserializeOwned,
    C: Config,
Available on crate feature serde only.
Expand description

Decode an owned type from the given slice. Will return the decoded type T as well as the amount of bytes that were read.

Note that this does not work with borrowed types like &str or &[u8]. For that use decode_borrowed_from_slice.