mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-28 22:20:36 +02:00
update deps and fix definitions
This commit is contained in:
@ -22,6 +22,7 @@ openssl = ["tokio-openssl"]
|
||||
rustls = ["tokio-rustls"]
|
||||
|
||||
[dependencies]
|
||||
tokio = "0.2.0-alpha.6"
|
||||
tokio-io = "0.2.0-alpha.6"
|
||||
tokio-net = "0.2.0-alpha.6"
|
||||
tokio-openssl = { version = "0.4.0-alpha.6", optional = true }
|
||||
tokio-rustls = { version = "0.12.0-alpha.8", optional = true }
|
||||
|
@ -5,8 +5,8 @@ use std::net::SocketAddr;
|
||||
use std::rc::Rc;
|
||||
use std::{fmt, io, net, ops, time};
|
||||
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::net::TcpStream;
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use tokio_net::tcp::TcpStream;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ServerConfig {
|
||||
@ -62,6 +62,8 @@ pub struct Io<T, P = ()> {
|
||||
params: P,
|
||||
}
|
||||
|
||||
impl<T: Unpin> Unpin for Io<T> {}
|
||||
|
||||
impl<T> Io<T, ()> {
|
||||
pub fn new(io: T) -> Self {
|
||||
Self {
|
||||
@ -141,7 +143,7 @@ impl<T: fmt::Debug, P> fmt::Debug for Io<T, P> {
|
||||
}
|
||||
|
||||
/// Low-level io stream operations
|
||||
pub trait IoStream: AsyncRead + AsyncWrite {
|
||||
pub trait IoStream: AsyncRead + AsyncWrite + Unpin {
|
||||
/// Returns the socket address of the remote peer of this TCP connection.
|
||||
fn peer_addr(&self) -> Option<SocketAddr> {
|
||||
None
|
||||
@ -224,7 +226,7 @@ impl<T: IoStream + Unpin> IoStream for tokio_rustls::server::TlsStream<T> {
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
impl IoStream for tokio::net::UnixStream {
|
||||
impl IoStream for tokio_net::uds::UnixStream {
|
||||
#[inline]
|
||||
fn peer_addr(&self) -> Option<net::SocketAddr> {
|
||||
None
|
||||
|
Reference in New Issue
Block a user