1#[cfg(feature = "tokio")]
4pub use ntex_tokio::{from_tcp_stream, tcp_connect};
5
6#[cfg(all(unix, feature = "tokio"))]
7pub use ntex_tokio::{from_unix_stream, unix_connect};
8
9#[cfg(all(feature = "compio", not(feature = "tokio"), not(feature = "neon")))]
10pub use ntex_compio::{from_tcp_stream, tcp_connect};
11
12#[cfg(all(
13 unix,
14 feature = "compio",
15 not(feature = "tokio"),
16 not(feature = "neon")
17))]
18pub use ntex_compio::from_unix_stream;
19
20#[cfg(all(feature = "compio", not(feature = "tokio"), not(feature = "neon")))]
21pub use ntex_compio::unix_connect;
22
23#[cfg(all(not(feature = "tokio"), not(feature = "compio"), not(feature = "neon")))]
24mod no_rt {
25 use ntex_io::Io;
26 use ntex_service::cfg::SharedCfg;
27
28 pub async fn tcp_connect(_: std::net::SocketAddr, _: SharedCfg) -> std::io::Result<Io> {
30 Err(std::io::Error::other("runtime is not configure"))
31 }
32
33 #[cfg(unix)]
34 pub async fn unix_connect<'a, P>(_: P, _: SharedCfg) -> std::io::Result<Io>
36 where
37 P: AsRef<std::path::Path> + 'a,
38 {
39 Err(std::io::Error::other("runtime is not configure"))
40 }
41
42 pub fn from_tcp_stream(_: std::net::TcpStream, _: SharedCfg) -> std::io::Result<Io> {
44 Err(std::io::Error::other("runtime is not configure"))
45 }
46
47 #[cfg(unix)]
48 pub fn from_unix_stream(
50 _: std::os::unix::net::UnixStream,
51 _: SharedCfg,
52 ) -> std::io::Result<Io> {
53 Err(std::io::Error::other("runtime is not configure"))
54 }
55}
56
57#[cfg(all(not(feature = "tokio"), not(feature = "compio"), not(feature = "neon")))]
58pub use no_rt::*;