1#![deny(clippy::pedantic)]
40#![allow(
41 type_alias_bounds,
42 missing_debug_implementations,
43 clippy::cast_possible_truncation,
44 clippy::missing_errors_doc,
45 clippy::missing_fields_in_debug,
46 clippy::missing_panics_doc,
47 clippy::must_use_candidate,
48 clippy::too_many_lines,
49 clippy::type_complexity,
50 clippy::unused_async_trait_impl
51)]
52#![cfg_attr(any(docsrs, docsrs_dep), allow(internal_features))]
54#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
55
56#[cfg(not(test))] pub use ntex_macros::{rt_main as main, rt_test as test};
58
59#[cfg(test)]
60pub(crate) use ntex_macros::rt_test_internal as rt_test;
61
62pub use ntex_service::forward;
63#[doc(hidden)]
64pub use ntex_service::{forward_bind, forward_ready, forward_shutdown};
65
66pub mod client;
67pub mod http;
68pub mod web;
69
70#[cfg(feature = "ws")]
71pub mod ws;
72
73pub use urly as url;
74
75pub use self::service::{
76 BindCtx, Ctx, IntoService, IntoServiceFactory, Middleware, Service, ServiceFactory, cfg::Cfg,
77 cfg::SharedCfg, factory, fn_service, pipeline::Pipeline, pipeline::PipelineBinding,
78 pipeline::PipelineFactory, service,
79};
80pub use ntex_error::Error;
81
82pub use ntex_util::{channel, task};
83
84pub mod codec {
85 pub use ntex_codec::*;
87}
88
89pub mod connect {
90 pub use ntex_net::connect::*;
92
93 #[cfg(feature = "openssl")]
94 pub mod openssl {
95 pub use ntex_tls::openssl::*;
97 }
98
99 #[cfg(feature = "rustls")]
100 pub mod rustls {
101 pub use ntex_tls::rustls::*;
103 }
104}
105
106pub mod router {
107 pub use ntex_router::*;
109}
110
111pub mod rt {
112 pub use ntex_rt::*;
114
115 pub use ntex_net::*;
116}
117
118pub mod service {
119 pub use ntex_service::*;
121}
122
123pub mod server {
124 pub use ntex_server::net::*;
126
127 #[cfg(feature = "openssl")]
128 pub use ntex_tls::openssl;
129
130 #[cfg(feature = "rustls")]
131 pub use ntex_tls::rustls;
132
133 pub use ntex_tls::{TlsConfig, TlsError};
134}
135
136pub mod time {
137 pub use ntex_util::time::*;
139}
140
141pub mod io {
142 pub use ntex_dispatcher::*;
144 pub use ntex_io::*;
145}
146
147pub mod testing {
148 pub use ntex_io::testing::IoTest;
150}
151
152pub mod tls {
153 pub use ntex_tls::*;
155}
156
157pub mod error {
158 pub use ntex_error::*;
160}
161
162pub mod util {
163 pub use ntex_bytes::{Buf, BufMut, ByteString, Bytes, BytesMut};
165 pub use ntex_bytes::{BytePage, BytePageSize, BytePages};
166 #[cfg(feature = "tracker")]
167 pub use ntex_bytes::{BytesTracker, BytesTrackerSnapshot};
168 pub use ntex_error::{ErrorMessage, ErrorMessageChained, fmt_err, fmt_err_string};
169 pub use ntex_util::{
170 Equivalent, HashMap, HashRandomState, HashSet, clone_io_error, dyn_err, dyn_rc_err,
171 future::*, hash_map, hash_set, services::*, str_rc_err,
172 };
173
174 #[doc(hidden)]
175 pub fn enable_test_logging() {
176 #[cfg(not(feature = "no-test-logging"))]
177 if std::env::var("NTEX_NO_TEST_LOG").is_err() {
178 if std::env::var("RUST_LOG").is_err() {
179 unsafe {
181 std::env::set_var("RUST_LOG", "trace");
182 }
183 }
184 let _ = env_logger::builder().is_test(true).try_init();
185 }
186 }
187}