diff --git a/tokio-util/src/codec/framed.rs b/tokio-util/src/codec/framed.rs index bf05a3ae8..b23f9386c 100644 --- a/tokio-util/src/codec/framed.rs +++ b/tokio-util/src/codec/framed.rs @@ -195,6 +195,11 @@ impl Framed { &self.inner.state.read.buffer } + /// Returns a mutable reference to the read buffer. + pub fn read_buffer_mut(&mut self) -> &mut BytesMut { + &mut self.inner.state.read.buffer + } + /// Consumes the `Framed`, returning its underlying I/O stream. /// /// Note that care should be taken to not tamper with the underlying stream