1//! Different implementations of a common async API for use in arti
2//!
3//! Currently only async_std and tokio are provided.
45#[cfg(feature = "async-std")]
6pub(crate) mod async_std;
78#[cfg(feature = "tokio")]
9pub(crate) mod tokio;
1011#[cfg(feature = "rustls")]
12pub(crate) mod rustls;
1314#[cfg(feature = "native-tls")]
15pub(crate) mod native_tls;
1617pub(crate) mod streamops;
1819/// Helper: Implement an unreachable NetProvider<unix::SocketAddr> for a given runtime.
20#[cfg(not(unix))]
21macro_rules! impl_unix_non_provider {
22 { $for_type:ty } => {
2324#[async_trait]
25impl crate::traits::NetStreamProvider<tor_general_addr::unix::SocketAddr> for $for_type {
26type Stream = crate::unimpl::FakeStream;
27type Listener = crate::unimpl::FakeListener<tor_general_addr::unix::SocketAddr>;
28async fn connect(&self, _a: &tor_general_addr::unix::SocketAddr) -> IoResult<Self::Stream> {
29Err(tor_general_addr::unix::NoAfUnixSocketSupport::default().into())
3031 }
32async fn listen(&self, _a: &tor_general_addr::unix::SocketAddr) -> IoResult<Self::Listener> {
33Err(tor_general_addr::unix::NoAfUnixSocketSupport::default().into())
34 }
35 }
36 }
37}
38#[cfg(not(unix))]
39pub(crate) use impl_unix_non_provider;