1use crate::{tcp::AbstractTcpStream, types::TargetAddr, udp::AbstractUdpSocket};
2
3pub trait FutResult<T> = Future<Output = eyre::Result<T>> + Send + Sync;
4
5pub trait AbstractInbound {
6 fn listen(&self, cb: &impl InboundCallback) -> impl FutResult<()>;
8}
9
10pub trait InboundCallback: Send + Sync {
11 fn handle_tcpstream(&self, target_addr: TargetAddr, stream: impl AbstractTcpStream) -> impl FutResult<()>;
12 fn handle_udpsocket(&self, socket: impl AbstractUdpSocket + 'static) -> impl FutResult<()>;
13}