mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
parent
236629d1be
commit
a3aab864d7
@ -60,16 +60,14 @@ pub trait AsyncBufRead: AsyncRead {
|
||||
|
||||
macro_rules! deref_async_buf_read {
|
||||
() => {
|
||||
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>)
|
||||
-> Poll<io::Result<&[u8]>>
|
||||
{
|
||||
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
|
||||
Pin::new(&mut **self.get_mut()).poll_fill_buf(cx)
|
||||
}
|
||||
|
||||
fn consume(mut self: Pin<&mut Self>, amt: usize) {
|
||||
Pin::new(&mut **self).consume(amt)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
impl<T: ?Sized + AsyncBufRead + Unpin> AsyncBufRead for Box<T> {
|
||||
|
@ -140,12 +140,14 @@ macro_rules! deref_async_read {
|
||||
(**self).prepare_uninitialized_buffer(buf)
|
||||
}
|
||||
|
||||
fn poll_read(mut self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8])
|
||||
-> Poll<io::Result<usize>>
|
||||
{
|
||||
fn poll_read(
|
||||
mut self: Pin<&mut Self>,
|
||||
cx: &mut Context<'_>,
|
||||
buf: &mut [u8],
|
||||
) -> Poll<io::Result<usize>> {
|
||||
Pin::new(&mut **self).poll_read(cx, buf)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
impl<T: ?Sized + AsyncRead + Unpin> AsyncRead for Box<T> {
|
||||
|
@ -55,13 +55,10 @@ macro_rules! deref_async_seek {
|
||||
Pin::new(&mut **self).start_seek(cx, pos)
|
||||
}
|
||||
|
||||
fn poll_complete(
|
||||
mut self: Pin<&mut Self>,
|
||||
cx: &mut Context<'_>,
|
||||
) -> Poll<io::Result<u64>> {
|
||||
fn poll_complete(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<u64>> {
|
||||
Pin::new(&mut **self).poll_complete(cx)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
impl<T: ?Sized + AsyncSeek + Unpin> AsyncSeek for Box<T> {
|
||||
|
@ -153,9 +153,11 @@ pub trait AsyncWrite {
|
||||
|
||||
macro_rules! deref_async_write {
|
||||
() => {
|
||||
fn poll_write(mut self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8])
|
||||
-> Poll<io::Result<usize>>
|
||||
{
|
||||
fn poll_write(
|
||||
mut self: Pin<&mut Self>,
|
||||
cx: &mut Context<'_>,
|
||||
buf: &[u8],
|
||||
) -> Poll<io::Result<usize>> {
|
||||
Pin::new(&mut **self).poll_write(cx, buf)
|
||||
}
|
||||
|
||||
@ -166,7 +168,7 @@ macro_rules! deref_async_write {
|
||||
fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
||||
Pin::new(&mut **self).poll_shutdown(cx)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
impl<T: ?Sized + AsyncWrite + Unpin> AsyncWrite for Box<T> {
|
||||
|
@ -3,7 +3,6 @@ use crate::io::PollEvented;
|
||||
use crate::net::unix::{Incoming, UnixStream};
|
||||
|
||||
use mio::Ready;
|
||||
use mio_uds;
|
||||
use std::convert::TryFrom;
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
|
Loading…
x
Reference in New Issue
Block a user