1use std::pin::Pin;
4use std::task::{Context, Poll};
5use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
6
7pub struct SendStream {
9 }
11
12impl SendStream {
13 pub(crate) fn new() -> Self {
15 Self {}
16 }
17}
18
19impl AsyncWrite for SendStream {
20 fn poll_write(
21 self: Pin<&mut Self>,
22 _cx: &mut Context<'_>,
23 buf: &[u8],
24 ) -> Poll<Result<usize, std::io::Error>> {
25 Poll::Ready(Ok(buf.len()))
26 }
27
28 fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<(), std::io::Error>> {
29 Poll::Ready(Ok(()))
30 }
31
32 fn poll_shutdown(
33 self: Pin<&mut Self>,
34 _cx: &mut Context<'_>,
35 ) -> Poll<Result<(), std::io::Error>> {
36 Poll::Ready(Ok(()))
37 }
38}
39
40pub struct RecvStream {
42 }
44
45impl RecvStream {
46 pub(crate) fn new() -> Self {
48 Self {}
49 }
50}
51
52impl AsyncRead for RecvStream {
53 fn poll_read(
54 self: Pin<&mut Self>,
55 _cx: &mut Context<'_>,
56 _buf: &mut ReadBuf<'_>,
57 ) -> Poll<std::io::Result<()>> {
58 Poll::Ready(Ok(()))
60 }
61}