2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 10:49:55 +00:00

Merge pull request #4 from matklad/fused-incoming

implement FusedStream for net::Incoming
This commit is contained in:
Stjepan Glavina 2019-08-09 17:44:57 +02:00 committed by GitHub
commit 3f6dfaf2f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@ use std::task::{Context, Poll};
use cfg_if::cfg_if; use cfg_if::cfg_if;
use futures::{prelude::*, ready}; use futures::{prelude::*, ready};
use futures::stream::FusedStream;
use crate::net::driver::IoHandle; use crate::net::driver::IoHandle;
@ -667,6 +668,10 @@ impl<'a> Stream for Incoming<'a> {
} }
} }
impl<'a> FusedStream for Incoming<'a> {
fn is_terminated(&self) -> bool { false }
}
impl From<net::TcpStream> for TcpStream { impl From<net::TcpStream> for TcpStream {
/// Converts a `std::net::TcpStream` into its asynchronous equivalent. /// Converts a `std::net::TcpStream` into its asynchronous equivalent.
fn from(stream: net::TcpStream) -> TcpStream { fn from(stream: net::TcpStream) -> TcpStream {