summaryrefslogtreecommitdiffstats
path: root/tokio-util/src/codec/framed_read.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio-util/src/codec/framed_read.rs')
-rw-r--r--tokio-util/src/codec/framed_read.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tokio-util/src/codec/framed_read.rs b/tokio-util/src/codec/framed_read.rs
index a6844b73..2077fbce 100644
--- a/tokio-util/src/codec/framed_read.rs
+++ b/tokio-util/src/codec/framed_read.rs
@@ -100,6 +100,11 @@ impl<T, D> FramedRead<T, D> {
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