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