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    Layer, Service, bytes, combinators, conversion, error, error_sink, extensions, futures, geo,
15    layer, matcher, service, username,
16};
17
18#[cfg(feature = "std")]
19#[doc(inline)]
20pub use ::rama_core::{ServiceInput, graceful, io, rt, stream};
21
22#[cfg(feature = "std")]
23#[doc(inline)]
24pub use ::rama_json as json;
25
26#[cfg(all(feature = "std", feature = "crypto"))]
27#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "crypto"))))]
28#[doc(inline)]
29pub use ::rama_crypto as crypto;
30
31#[cfg(all(target_family = "unix", feature = "unix"))]
32#[cfg_attr(docsrs, doc(cfg(all(target_family = "unix", feature = "unix"))))]
33#[doc(inline)]
34pub use ::rama_unix as unix;
35
36#[cfg(all(feature = "std", feature = "tcp"))]
37#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "tcp"))))]
38#[doc(inline)]
39pub use ::rama_tcp as tcp;
40
41#[cfg(all(feature = "std", feature = "udp"))]
42#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "udp"))))]
43#[doc(inline)]
44pub use ::rama_udp as udp;
45
46#[cfg(feature = "std")]
47pub mod telemetry;
48
49#[cfg(any(
50    all(feature = "std", feature = "tls"),
51    all(feature = "std", feature = "rustls"),
52    all(feature = "std", feature = "boring"),
53    all(feature = "std", feature = "acme")
54))]
55pub mod tls;
56
57#[cfg(all(feature = "std", feature = "dns"))]
58#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "dns"))))]
59#[doc(inline)]
60pub use ::rama_dns as dns;
61
62#[cfg(feature = "net")]
63pub mod net {
64    #[cfg_attr(docsrs, doc(cfg(feature = "net")))]
65    #[doc(inline)]
66    pub use ::rama_net::*;
67
68    #[cfg(any(
69        all(doc, docsrs),
70        all(
71            target_vendor = "apple",
72            any(feature = "net-apple-networkextension", feature = "net-apple-xpc")
73        )
74    ))]
75    #[cfg_attr(docsrs, doc(cfg(target_vendor = "apple")))]
76    pub mod apple {
77        //! Apple (vendor) specific network modules
78
79        #[cfg(feature = "net-apple-networkextension")]
80        #[cfg_attr(docsrs, doc(cfg(feature = "net-apple-networkextension")))]
81        #[doc(inline)]
82        pub use ::rama_net_apple_networkextension as networkextension;
83
84        #[cfg(feature = "net-apple-xpc")]
85        #[cfg_attr(docsrs, doc(cfg(feature = "net-apple-xpc")))]
86        #[doc(inline)]
87        pub use ::rama_net_apple_xpc as xpc;
88    }
89}
90
91#[cfg(all(feature = "std", feature = "http"))]
92#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "http"))))]
93pub mod http;
94
95#[cfg(any(
96    all(feature = "std", feature = "proxy"),
97    all(feature = "std", feature = "haproxy"),
98    all(feature = "std", feature = "socks5")
99))]
100pub mod proxy {
101    //! rama proxy support
102
103    #[cfg(feature = "proxy")]
104    #[cfg_attr(docsrs, doc(cfg(feature = "proxy")))]
105    #[doc(inline)]
106    pub use ::rama_proxy::*;
107
108    #[cfg(feature = "haproxy")]
109    #[cfg_attr(docsrs, doc(cfg(feature = "haproxy")))]
110    #[doc(inline)]
111    pub use ::rama_haproxy as haproxy;
112
113    #[cfg(feature = "socks5")]
114    #[cfg_attr(docsrs, doc(cfg(feature = "socks5")))]
115    #[doc(inline)]
116    pub use ::rama_socks5 as socks5;
117}
118
119/// Application server gateway protocols (FastCGI, and similar).
120#[cfg(all(feature = "std", feature = "fastcgi"))]
121#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "fastcgi"))))]
122pub mod gateway {
123    #[cfg(feature = "fastcgi")]
124    #[cfg_attr(docsrs, doc(cfg(feature = "fastcgi")))]
125    #[doc(inline)]
126    pub use ::rama_fastcgi as fastcgi;
127}
128
129/// ttRPC ("gRPC for low-memory environments") support.
130///
131/// Unlike `grpc`, ttRPC does not ride on HTTP/2, it is a length-prefixed framing
132/// directly on the byte stream, used by container runtimes and their plugins.
133#[cfg(feature = "ttrpc")]
134#[cfg_attr(docsrs, doc(cfg(feature = "ttrpc")))]
135#[doc(inline)]
136pub use ::rama_ttrpc as ttrpc;
137
138#[cfg(all(feature = "std", feature = "ua"))]
139#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "ua"))))]
140#[doc(inline)]
141pub use ::rama_ua as ua;
142
143#[cfg(all(feature = "std", feature = "cli"))]
144#[cfg_attr(docsrs, doc(cfg(all(feature = "std", feature = "cli"))))]
145pub mod cli;
146
147pub mod utils {
148    //! utilities for rama
149
150    #[doc(inline)]
151    pub use ::rama_utils::*;
152
153    #[cfg(feature = "tower")]
154    #[cfg_attr(docsrs, doc(cfg(feature = "tower")))]
155    #[doc(inline)]
156    pub use ::rama_tower as tower;
157}