feat(server): add poll_peek to AddrStream (#2127)
This commit is contained in:
@@ -223,6 +223,17 @@ mod addr_stream {
|
|||||||
pub fn into_inner(self) -> TcpStream {
|
pub fn into_inner(self) -> TcpStream {
|
||||||
self.inner
|
self.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Attempt to receive data on the socket, without removing that data
|
||||||
|
/// from the queue, registering the current task for wakeup if data is
|
||||||
|
/// not yet available.
|
||||||
|
pub fn poll_peek(
|
||||||
|
&mut self,
|
||||||
|
cx: &mut task::Context<'_>,
|
||||||
|
buf: &mut [u8],
|
||||||
|
) -> Poll<io::Result<usize>> {
|
||||||
|
self.inner.poll_peek(cx, buf)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AsyncRead for AddrStream {
|
impl AsyncRead for AddrStream {
|
||||||
|
|||||||
Reference in New Issue
Block a user