diff --git a/tokio-util/src/codec/framed_read.rs b/tokio-util/src/codec/framed_read.rs index a6844b735..2077fbcee 100644 --- a/tokio-util/src/codec/framed_read.rs +++ b/tokio-util/src/codec/framed_read.rs @@ -100,6 +100,11 @@ impl FramedRead { pub fn read_buffer(&self) -> &BytesMut { &self.inner.state.buffer } + + /// Returns a mutable reference to the read buffer. + pub fn read_buffer_mut(&mut self) -> &mut BytesMut { + &mut self.inner.state.buffer + } } // This impl just defers to the underlying FramedImpl