1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// Copyright © 2023-2026 Common (CMN) library. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! # Common (CMN)
//!
//! 121 mathematical and cryptographic constants for Rust.
//! Zero runtime cost. `no_std` compatible.
//!
//! ## Why CMN?
//!
//! `std::f64::consts` provides 11 mathematical constants. CMN
//! extends that with 44 physical, cryptographic, and series
//! constants — plus a runtime lookup API, 14 utility macros,
//! and a built-in word-list module. Every constant resolves at
//! compile time. Works in `no_std` environments.
//!
//! ## Modules
//!
//! - **[`constants`]** — 121 `const` values (PI, Avogadro,
//! Planck, etc.). With `std`: runtime `Constants` lookup API
//! + `ConstantValue` typed enum.
//! - **[`macros`]** — 14 utility macros for min/max,
//! range-checks, collections, and parsing.
//! - With `std` feature: **[`words`]** module, **[`datetime`]**
//! utilities, and **`Common`** JSON bridge.
//!
//! ## Quick Start
//!
//! ```rust
//! // Compile-time constants — always available, even in no_std
//! use cmn::constants::{PI, EULER, SPEED_OF_LIGHT};
//!
//! assert_eq!(PI, core::f64::consts::PI);
//! ```
//!
//! ```rust
//! // Runtime lookup — requires the `std` feature (default)
//! use cmn::Constants;
//! use cmn::Words;
//! use cmn::words::WORD_LIST;
//!
//! let constants = Constants::new();
//! let euler = constants.constant("EULER").unwrap();
//! assert_eq!(euler.name, "EULER");
//!
//! let words = Words::default();
//! let list = words.words_list();
//! assert_eq!(list.len(), WORD_LIST.len());
//! assert_eq!(list[0], "aboard");
//! ```
//!
//! ## Feature Flags
//!
//! | Feature | Default | Enables |
//! |---------|---------|---------|
//! | `std` | Yes | `Constants` struct, `Words`, `Common`, serde support |
//!
//! For `no_std`, disable default features:
//! ```toml
//! [dependencies]
//! cmn = { version = "0.0.6", default-features = false }
//! ```
//!
//! ## License
//!
//! Dual-licensed under
//! [Apache 2.0](https://opensource.org/licenses/Apache-2.0) or
//! [MIT](https://opensource.org/licenses/MIT), at your option.
//!
use ;
/// 14 utility macros for assertions, collections, range-checks,
/// and string operations. Available in `no_std`.
/// 121 mathematical, physical, and cryptographic constants as
/// compile-time `const` values. The `const` values are always
/// available, even in `no_std`. The runtime `Constants` lookup
/// API and `ConstantValue` enum require the `std` feature.
pub use Constants;
/// A word-list module for passphrase generation and text
/// processing. Backed by `HashSet<String>` for O(1) lookups
/// with a curated built-in `WORD_LIST`. Requires `std`.
pub use Words;
/// Lightweight datetime utilities for ISO 8601 parsing,
/// relative time formatting, and duration calculations.
/// No external datetime crate required. Requires `std`.
/// The `Common` structure provides a central location to store
/// data that is commonly used throughout the library. Requires
/// the `std` feature for serde JSON support.
///
/// # Fields
///
/// * `constants`: A reference to the `Constants` structure.
/// * `words`: A reference to the `Words` structure.
/// Main entry point for the `Common (CMN)` library.
/// Requires `std`.