1use futures_core::Stream;
2use futures_io::{AsyncRead, AsyncWrite};
3use std::{
4 io,
5 marker::PhantomData,
6 pin::Pin,
7 task::{Context, Poll},
8};
9
10#[derive(Debug)]
15pub struct DummyIO;
16
17impl AsyncRead for DummyIO {
18 fn poll_read(
19 self: Pin<&mut Self>,
20 _cx: &mut Context<'_>,
21 _buf: &mut [u8],
22 ) -> Poll<io::Result<usize>> {
23 Poll::Pending
24 }
25}
26
27impl AsyncWrite for DummyIO {
28 fn poll_write(
29 self: Pin<&mut Self>,
30 _cx: &mut Context<'_>,
31 _buf: &[u8],
32 ) -> Poll<io::Result<usize>> {
33 Poll::Pending
34 }
35
36 fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<()>> {
37 Poll::Pending
38 }
39
40 fn poll_close(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<()>> {
41 Poll::Pending
42 }
43}
44
45#[derive(Debug)]
50pub struct DummyStream<T>(pub PhantomData<T>);
51
52impl<T> Stream for DummyStream<T> {
53 type Item = T;
54
55 fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
56 Poll::Pending
57 }
58}