use async_trait::async_trait;
use std::fmt::Debug;
use crate::address::{NetLocation, ResolvedLocation};
use crate::async_stream::{AsyncMessageStream, AsyncStream};
use crate::tcp::tcp_handler::TcpClientSetupResult;
#[async_trait]
#[allow(
clippy::double_must_use,
reason = "async-trait adds must_use to boxed futures"
)]
pub trait ProxyConnector: Send + Sync + Debug {
fn proxy_location(&self) -> &NetLocation;
fn supports_udp_over_tcp(&self) -> bool;
async fn setup_tcp_stream(
&self,
stream: Box<dyn AsyncStream>,
target: &ResolvedLocation,
) -> std::io::Result<TcpClientSetupResult>;
async fn setup_udp_bidirectional(
&self,
stream: Box<dyn AsyncStream>,
target: ResolvedLocation,
) -> std::io::Result<Box<dyn AsyncMessageStream>>;
}