pub fn read_message<T: Readable>(stream: &mut dyn Read, msg_type: Type) -> Result<T, Error> {
	let header = read_header(stream, Some(msg_type))?;
	if header.msg_type != msg_type {
		return Err(Error::BadMessage);
	}
	read_body(&header, stream)
}
/// Reads a full message from the underlying stream.
Reads a full message from the underlying stream.
Reads a full message from the underlying stream .
pub fn read_message<T: Readable>(stream: &mut dyn Read, msg_type: Type) -> Result<T, Error> {
	let header = read_header(stream, Some(msg_type))?;
	if header.msg_type != msg_type {
		return Err(Error::BadMessage);
	}
	read_body(&header, stream)
}
pub fn read_message < T : Readable > ( stream : & mut dyn Read , msg_type : Type ) -> Result < T , Error > { let header = read_header ( stream , Some ( msg_type ) ) ? ; if header . msg_type != msg_type { return Err ( Error :: BadMessage ) ; } read_body ( & header , stream ) }
Reads a full message from the underlying stream.
Reads a full message from the underlying stream .
stream
&mut dyn Read
msg_type
Type