1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-07-01 12:15:08 +02:00

Optionally support tokio-uds's UnixStream as IoStream (#472)

This commit is contained in:
Kornel
2018-08-17 17:04:16 +01:00
committed by Douman
parent 8fe30a5b66
commit bdc9a8bb07
6 changed files with 44 additions and 0 deletions

View File

@ -421,6 +421,24 @@ pub trait IoStream: AsyncRead + AsyncWrite + 'static {
}
}
#[cfg(all(unix, feature = "uds"))]
impl IoStream for ::tokio_uds::UnixStream {
#[inline]
fn shutdown(&mut self, how: Shutdown) -> io::Result<()> {
::tokio_uds::UnixStream::shutdown(self, how)
}
#[inline]
fn set_nodelay(&mut self, _nodelay: bool) -> io::Result<()> {
Ok(())
}
#[inline]
fn set_linger(&mut self, _dur: Option<time::Duration>) -> io::Result<()> {
Ok(())
}
}
impl IoStream for TcpStream {
#[inline]
fn shutdown(&mut self, how: Shutdown) -> io::Result<()> {