Skip to main content

from_bytes_with_rest

Function from_bytes_with_rest 

Source
pub fn from_bytes_with_rest<'a, T>(
    buf: &'a [u8],
) -> Result<(T, &'a [u8]), ErrorWithContext<'a>>
where T: Deserialize<'a>,
Expand description

Deserialize a bencode value at the start of the buffer, return it and the remaining bytes.