Function bincode::decode_from [] [src]

pub fn decode_from<R: Read, T: Decodable>(r: &mut R, size_limit: SizeLimit) -> DecodingResult<(T, u64)>

Decodes an object directly from a Reader. If successful, returns the decoded object and the number of bytes read out of the Reader.

If the provided SizeLimit is reached, the decode will bail immediately. A SizeLimit can help prevent an attacker from flooding your server with a neverending stream of values that runs your server out of memory.

If this returns an DecodingError, assume that the buffer that you passed in is in an invalid state, as the error could be returned during any point in the reading.