[][src]Function bt_bencode::from_slice

pub fn from_slice<'a, T>(s: &'a [u8]) -> Result<T> where
    T: Deserialize<'a>, 

Deserializes an instance of T from a slice of bytes.

Errors

Deserialization can fail if the data is not valid, if the data cannot cannot be deserialized into an instance of T, and other IO errors.