Skip to main content

rama/
lib.rs

1#![doc = include_str!("lib_docs.md")]
2#![doc(
3    html_favicon_url = "https://raw.githubusercontent.com/plabayo/rama/main/docs/img/rama_logo.svg"
4)]
5#![doc(
6    html_logo_url = "https://raw.githubusercontent.com/plabayo/rama/main/docs/img/rama_logo.svg"
7)]
8#![cfg_attr(docsrs, feature(doc_cfg))]
9#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
10#![cfg_attr(test, allow(clippy::float_cmp))]
11
12#[doc(inline)]
13pub use ::rama_core::{
14    BlockingService, Fork, Layer, Service, bytes, combinators, conversion, error, error_sink,
15    extensions, futures, geo, layer, matcher, service, username,
16};
17#[cfg(feature = "std")]
18#[doc(inline)]
19pub use ::rama_core::{ServiceInput, graceful, io, rt, stream};
20#[cfg(feature = "std")]
21#[doc(inline)]
22pub use ::rama_json as json;
23
24#[cfg(all(feature = "std", feature = "js"))]
25#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "js"))))]
26pub mod js {
27    //! Embedded javascript execution, see [`rama_js`] for more info.
28
29    #[doc(inline)]
30    pub use ::rama_js::*;
31    #[cfg(feature = "pac")]
32    #[cfg_attr(docsrs, doc(cfg(feature = "pac")))]
33    #[doc(inline)]
34    pub use ::rama_pac as pac;
35}
36
37#[cfg(all(feature = "std", feature = "crypto"))]
38#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "crypto"))))]
39#[doc(inline)]
40pub use ::rama_crypto as crypto;
41#[cfg(all(feature = "std", feature = "tcp"))]
42#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "tcp"))))]
43#[doc(inline)]
44pub use ::rama_tcp as tcp;
45#[cfg(all(feature = "std", feature = "udp"))]
46#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "udp"))))]
47#[doc(inline)]
48pub use ::rama_udp as udp;
49#[cfg(all(target_family = "unix", feature = "unix"))]
50#[cfg_attr(docsrs, doc(cfg(all(target_family = "unix", feature = "unix"))))]
51#[doc(inline)]
52pub use ::rama_unix as unix;
53
54/// QUIC: the deterministic wire-protocol vocabulary and the async engine built on it.
55///
56/// [`proto`](quic::proto) is [`rama-quic-proto`](::rama_quic_proto) — the packet and frame codec,
57/// version vocabulary and typed wire profiles, usable without the engine. The engine
58/// ([`rama-quic`](::rama_quic)) is re-exported at this module's root.
59#[cfg(feature = "quic")]
60#[cfg_attr(docsrs, doc(cfg(feature = "quic")))]
61pub mod quic {
62    #[cfg(feature = "std")]
63    #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
64    #[doc(inline)]
65    pub use ::rama_quic::*;
66
67    #[doc(inline)]
68    pub use ::rama_quic_proto as proto;
69}
70
71#[cfg(feature = "std")]
72pub mod telemetry;
73
74#[cfg(any(
75    all(feature = "std", feature = "tls"),
76    all(feature = "std", feature = "rustls"),
77    all(feature = "std", feature = "boring"),
78    all(feature = "std", feature = "acme")
79))]
80pub mod tls;
81
82#[cfg(all(feature = "std", feature = "dns"))]
83#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "dns"))))]
84#[doc(inline)]
85pub use ::rama_dns as dns;
86
87#[cfg(feature = "net")]
88pub mod net {
89    #[cfg_attr(docsrs, doc(cfg(feature = "net")))]
90    #[doc(inline)]
91    pub use ::rama_net::*;
92
93    #[cfg(any(
94        all(doc, docsrs),
95        all(
96            target_vendor = "apple",
97            any(feature = "net-apple-networkextension", feature = "net-apple-xpc")
98        )
99    ))]
100    #[cfg_attr(docsrs, doc(cfg(target_vendor = "apple")))]
101    pub mod apple {
102        //! Apple (vendor) specific network modules
103
104        #[cfg(feature = "net-apple-networkextension")]
105        #[cfg_attr(docsrs, doc(cfg(feature = "net-apple-networkextension")))]
106        #[doc(inline)]
107        pub use ::rama_net_apple_networkextension as networkextension;
108        #[cfg(feature = "net-apple-xpc")]
109        #[cfg_attr(docsrs, doc(cfg(feature = "net-apple-xpc")))]
110        #[doc(inline)]
111        pub use ::rama_net_apple_xpc as xpc;
112    }
113}
114
115#[cfg(all(feature = "std", feature = "http"))]
116#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "http"))))]
117pub mod http;
118
119#[cfg(feature = "icap")]
120#[cfg_attr(docsrs, doc(cfg(feature = "icap")))]
121#[doc(inline)]
122pub use ::rama_icap as icap;
123
124#[cfg(any(
125    all(feature = "std", feature = "proxy"),
126    all(feature = "std", feature = "haproxy"),
127    all(feature = "std", feature = "socks5")
128))]
129pub mod proxy {
130    //! rama proxy support
131
132    #[cfg(feature = "haproxy")]
133    #[cfg_attr(docsrs, doc(cfg(feature = "haproxy")))]
134    #[doc(inline)]
135    pub use ::rama_haproxy as haproxy;
136    #[cfg(feature = "proxy")]
137    #[cfg_attr(docsrs, doc(cfg(feature = "proxy")))]
138    #[doc(inline)]
139    pub use ::rama_proxy::*;
140    #[cfg(feature = "socks5")]
141    #[cfg_attr(docsrs, doc(cfg(feature = "socks5")))]
142    #[doc(inline)]
143    pub use ::rama_socks5 as socks5;
144}
145
146/// Application server gateway protocols (FastCGI, and similar).
147#[cfg(all(feature = "std", feature = "fastcgi"))]
148#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "fastcgi"))))]
149pub mod gateway {
150    #[cfg(feature = "fastcgi")]
151    #[cfg_attr(docsrs, doc(cfg(feature = "fastcgi")))]
152    #[doc(inline)]
153    pub use ::rama_fastcgi as fastcgi;
154}
155
156/// ttRPC ("gRPC for low-memory environments") support.
157///
158/// Unlike `grpc`, ttRPC does not ride on HTTP/2, it is a length-prefixed framing
159/// directly on the byte stream, used by container runtimes and their plugins.
160#[cfg(feature = "ttrpc")]
161#[cfg_attr(docsrs, doc(cfg(feature = "ttrpc")))]
162#[doc(inline)]
163pub use ::rama_ttrpc as ttrpc;
164#[cfg(all(feature = "std", feature = "ua"))]
165#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "ua"))))]
166#[doc(inline)]
167pub use ::rama_ua as ua;
168
169#[cfg(all(feature = "std", feature = "cli"))]
170#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "cli"))))]
171pub mod cli;
172
173pub mod utils {
174    //! utilities for rama
175
176    #[cfg(feature = "tower")]
177    #[cfg_attr(docsrs, doc(cfg(feature = "tower")))]
178    #[doc(inline)]
179    pub use ::rama_tower as tower;
180    #[doc(inline)]
181    pub use ::rama_utils::*;
182}
183
184#[cfg(feature = "inspect")]
185#[cfg_attr(docsrs, doc(cfg(feature = "inspect")))]
186#[doc(inline)]
187pub use ::rama_inspect as inspect;