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))]
131pub mod proxy {
132    //! rama proxy support
133
134    #[cfg(feature = "haproxy")]
135    #[cfg_attr(docsrs, doc(cfg(feature = "haproxy")))]
136    #[doc(inline)]
137    pub use ::rama_haproxy as haproxy;
138    #[cfg(feature = "proxy")]
139    #[cfg_attr(docsrs, doc(cfg(feature = "proxy")))]
140    #[doc(inline)]
141    pub use ::rama_proxy::*;
142    #[cfg(feature = "socks5")]
143    #[cfg_attr(docsrs, doc(cfg(feature = "socks5")))]
144    #[doc(inline)]
145    pub use ::rama_socks5 as socks5;
146}
147
148/// Application server gateway protocols (FastCGI, and similar).
149#[cfg(all(feature = "std", feature = "fastcgi"))]
150#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "fastcgi"))))]
151pub mod gateway {
152    #[cfg(feature = "fastcgi")]
153    #[cfg_attr(docsrs, doc(cfg(feature = "fastcgi")))]
154    #[doc(inline)]
155    pub use ::rama_fastcgi as fastcgi;
156}
157
158/// ttRPC ("gRPC for low-memory environments") support.
159///
160/// Unlike `grpc`, ttRPC does not ride on HTTP/2, it is a length-prefixed framing
161/// directly on the byte stream, used by container runtimes and their plugins.
162#[cfg(feature = "ttrpc")]
163#[cfg_attr(docsrs, doc(cfg(feature = "ttrpc")))]
164#[doc(inline)]
165pub use ::rama_ttrpc as ttrpc;
166#[cfg(all(feature = "std", feature = "ua"))]
167#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "ua"))))]
168#[doc(inline)]
169pub use ::rama_ua as ua;
170
171#[cfg(all(feature = "std", feature = "cli"))]
172#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "cli"))))]
173pub mod cli;
174
175pub mod utils {
176    //! utilities for rama
177
178    #[cfg(feature = "tower")]
179    #[cfg_attr(docsrs, doc(cfg(feature = "tower")))]
180    #[doc(inline)]
181    pub use ::rama_tower as tower;
182    #[doc(inline)]
183    pub use ::rama_utils::*;
184}
185
186#[cfg(feature = "inspect")]
187#[cfg_attr(docsrs, doc(cfg(feature = "inspect")))]
188#[doc(inline)]
189pub use ::rama_inspect as inspect;