codec: add read_buffer_mut to FramedRead (#3166)

This commit is contained in:
漂流
2020-11-24 09:39:16 +01:00
committed by GitHub
parent ae67851f11
commit 874fc3320b
+5
View File
@@ -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