mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-27 01:37:42 +02:00
Remove unused types in actix-tls. Add ActixStream impl for Box<dyn Ac… (#297)
This commit is contained in:
@ -87,7 +87,7 @@ pub mod net {
|
||||
pub use tokio::net::{UnixDatagram, UnixListener, UnixStream};
|
||||
|
||||
/// Extension trait over async read+write types that can also signal readiness.
|
||||
pub trait ActixStream: AsyncRead + AsyncWrite + Unpin + 'static {
|
||||
pub trait ActixStream: AsyncRead + AsyncWrite + Unpin {
|
||||
/// Poll stream and check read readiness of Self.
|
||||
///
|
||||
/// See [tokio::net::TcpStream::poll_read_ready] for detail on intended use.
|
||||
@ -127,6 +127,16 @@ pub mod net {
|
||||
ready.poll(cx)
|
||||
}
|
||||
}
|
||||
|
||||
impl<Io: ActixStream + ?Sized> ActixStream for Box<Io> {
|
||||
fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<Ready>> {
|
||||
(**self).poll_read_ready(cx)
|
||||
}
|
||||
|
||||
fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<Ready>> {
|
||||
(**self).poll_write_ready(cx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod time {
|
||||
|
Reference in New Issue
Block a user