fire_stream/util/
testing.rs

1use super::listener::{SocketAddr, Listener};
2
3use std::io;
4use std::task::{Poll, Context};
5use std::pin::Pin;
6
7use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
8
9
10/// Always Panics
11pub struct PanicListener;
12
13impl PanicListener {
14	pub fn new() -> Self {
15		Self
16	}
17}
18
19impl Listener for PanicListener {
20	type Stream = PanicStream;
21
22	fn poll_accept(
23		&self,
24		_cx: &mut Context<'_>
25	) -> Poll<io::Result<(Self::Stream, SocketAddr)>> {
26		todo!("poll_accept")
27	}
28}
29
30pub struct PanicStream;
31
32impl AsyncRead for PanicStream {
33	fn poll_read(
34		self: Pin<&mut Self>,
35		_cx: &mut Context<'_>,
36		_buf: &mut ReadBuf<'_>
37	) -> Poll<io::Result<()>> {
38		todo!("poll_read")
39	}
40}
41
42impl AsyncWrite for PanicStream {
43	fn poll_write(
44		self: Pin<&mut Self>,
45		_cx: &mut Context<'_>,
46		_buf: &[u8]
47	) -> Poll<io::Result<usize>> {
48		todo!("poll_write")
49	}
50
51	fn poll_flush(
52		self: Pin<&mut Self>,
53		_cx: &mut Context<'_>
54	) -> Poll<io::Result<()>> {
55		todo!("poll_flush")
56	}
57
58	fn poll_shutdown(
59		self: Pin<&mut Self>,
60		_cx: &mut Context<'_>
61	) -> Poll<io::Result<()>> {
62		todo!("poll_shutdown")
63	}
64}