pub async fn decode<R: AsyncRead + Send + Unpin + 'static>(
    reader: &mut R,
    rest: &mut Vec<u8>
) -> Result<RpcMessage, Box<DecodeError>>
Expand description

Continously reads from reader, pushing onto rest. Then tries to decode the contents of rest. If it succeeds, returns the message, and leaves any non-decoded bytes in rest. If we did not read enough for a full message, read more. Return on all other errors.