mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
Add top-level tests for futures 0.2 integration (#231)
This commit is contained in:
@@ -139,6 +139,14 @@ impl TcpStream {
|
||||
self.io.poll_read_ready(mask)
|
||||
}
|
||||
|
||||
/// Like `poll_read_ready`, but compatible with futures 0.2
|
||||
#[cfg(feature = "unstable-futures")]
|
||||
pub fn poll_read_ready2(&self, cx: &mut futures2::task::Context, mask: mio::Ready)
|
||||
-> futures2::Poll<mio::Ready, io::Error>
|
||||
{
|
||||
self.io.poll_read_ready2(cx, mask)
|
||||
}
|
||||
|
||||
/// Check the TCP stream's write readiness state.
|
||||
///
|
||||
/// This always checks for writable readiness and also checks for HUP
|
||||
@@ -160,6 +168,14 @@ impl TcpStream {
|
||||
self.io.poll_write_ready()
|
||||
}
|
||||
|
||||
/// Like `poll_write_ready`, but compatible with futures 0.2.
|
||||
#[cfg(feature = "unstable-futures")]
|
||||
pub fn poll_write_ready2(&self, cx: &mut futures2::task::Context)
|
||||
-> futures2::Poll<mio::Ready, io::Error>
|
||||
{
|
||||
self.io.poll_write_ready2(cx)
|
||||
}
|
||||
|
||||
/// Returns the local address that this stream is bound to.
|
||||
pub fn local_addr(&self) -> io::Result<SocketAddr> {
|
||||
self.io.get_ref().local_addr()
|
||||
|
||||
Reference in New Issue
Block a user