mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-03 00:00:05 +02:00
Allow non-destructive access to the read buffer. (#1600)
I need this to implement SMTP pipelining checks. I mostly need to flush my send buffer when the read buffer is empty before waiting for the next command.
This commit is contained in:
committed by
Lucio Franco
parent
630d3136dd
commit
2902e39db0
@@ -120,6 +120,11 @@ impl<T, U> Framed<T, U> {
|
||||
&mut self.inner.get_mut().get_mut().1
|
||||
}
|
||||
|
||||
/// Returns a reference to the read buffer.
|
||||
pub fn read_buffer(&self) -> &BytesMut {
|
||||
self.inner.buffer()
|
||||
}
|
||||
|
||||
/// Consumes the `Frame`, returning its underlying I/O stream.
|
||||
///
|
||||
/// Note that care should be taken to not tamper with the underlying stream
|
||||
|
||||
Reference in New Issue
Block a user