Skip to content

Commit

Permalink
codec: add read_buffer_mut to FramedRead (#3166)
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo authored Nov 24, 2020
1 parent ae67851 commit 874fc33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tokio-util/src/codec/framed_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 874fc33

Please sign in to comment.