pub fn read_item<T: Readable>(stream: &mut dyn Read) -> Result<(T, u64), Error> {
	let timeout = time::Duration::from_secs(20);
	let mut reader = StreamingReader::new(stream, timeout);
	let res = T::read(&mut reader)?;
	Ok((res, reader.total_bytes_read()))
}
/// Read a single item from the provided stream, always blocking until we
/// have a result (or timeout).
/// Returns the item and the total bytes read.
Read a single item from the provided stream, always blocking until we
have a result (or timeout).
Returns the item and the total bytes read.
Read a single item from the provided stream always blocking until we have a result ( or timeout ) . Returns the item and the total bytes read .
pub fn read_item<T: Readable>(stream: &mut dyn Read) -> Result<(T, u64), Error> {
	let timeout = time::Duration::from_secs(20);
	let mut reader = StreamingReader::new(stream, timeout);
	let res = T::read(&mut reader)?;
	Ok((res, reader.total_bytes_read()))
}
pub fn read_item < T : Readable > ( stream : & mut dyn Read ) -> Result < ( T , u64 ) , Error > { let timeout = time :: Duration :: from_secs ( 20 ) ; let mut reader = StreamingReader :: new ( stream , timeout ) ; let res = T :: read ( & mut reader ) ? ; Ok ( ( res , reader . total_bytes_read ( ) ) ) }
Read a single item from the provided stream, always blocking until we
have a result (or timeout).
Read a single item from the provided stream always blocking until we have a result ( or timeout ) .
stream
&mut dyn Read