pub fn decode_with_limit(
buf: &mut BytesMut,
max: usize,
) -> Result<Option<BackendMessage>, Error>Expand description
Like decode, but rejects any message whose declared body length exceeds
max bytes before anything is buffered.
max is clamped to at most i32::MAX (the largest length expressible on
the wire).
ยงErrors
Returns Error::Decode when the message is malformed or larger than
max.