Skip to main content

read_reply_within

Function read_reply_within 

Source
pub async fn read_reply_within<R: AsyncRead + Unpin, T: DeserializeOwned>(
    reader: &mut R,
    max: usize,
) -> Result<T, CodecError>
Expand description

As read_reply, refusing a reply longer than max (at most MAX_REPLY) once its length is read, before any of it is held: what a request whose answer has a smaller bound of its own reads it with.