Skip to main content

rama_utils/
lib.rs

1//! utilities crate for rama
2//!
3//! `rama-utils` contains utilities used by `rama`,
4//! not really being part of one of the other crates, or used
5//! by plenty of other crates.
6//!
7//! # Rama
8//!
9//! Crate used by the end-user `rama` crate and `rama` crate authors alike.
10//!
11//! Learn more about `rama`:
12//!
13//! - Github: <https://github.com/plabayo/rama>
14//! - Book: <https://ramaproxy.org/book/>
15
16#![doc(
17    html_favicon_url = "https://raw.githubusercontent.com/plabayo/rama/main/docs/img/rama_logo.svg"
18)]
19#![doc(
20    html_logo_url = "https://raw.githubusercontent.com/plabayo/rama/main/docs/img/rama_logo.svg"
21)]
22#![cfg_attr(docsrs, feature(doc_cfg))]
23#![cfg_attr(test, allow(clippy::float_cmp))]
24#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
25
26#[cfg(not(feature = "std"))]
27extern crate alloc;
28
29#[doc(hidden)]
30#[macro_use]
31pub mod macros;
32
33#[cfg(feature = "std")]
34#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
35pub mod fs;
36
37#[cfg(feature = "std")]
38#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
39pub mod include_dir;
40
41#[cfg(feature = "std")]
42#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
43pub mod backoff;
44
45#[cfg(feature = "std")]
46#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
47pub mod reactive;
48
49#[cfg(feature = "std")]
50#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
51pub mod time;
52
53pub mod byte_set;
54pub mod bytes;
55pub mod collections;
56pub mod hex;
57pub mod info;
58pub mod latency;
59pub mod octets;
60pub mod rng;
61pub mod str;
62
63mod std;
64
65#[doc(hidden)]
66pub mod test_helpers;
67
68#[cfg(feature = "std")]
69#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
70pub mod thirdparty {
71    //! Thirdparty utilities.
72    //!
73    //! These are external dependencies which are used throughout
74    //! the rama ecosystem and which are stable enough
75    //! to be re-exported here for your utility.
76    //!
77    //! Re-export only: keep these deps out of `no_std` graphs
78    //! (e.g. kernel drivers) — regex links `std` transitively.
79
80    pub use ::regex;
81    pub use ::wildcard;
82}