wickra_embed_core/indicators/mod.rs
1//! The verified no-alloc indicator subset.
2//!
3//! Each indicator here reproduces the exact floating-point recurrence of its
4//! `wickra-core` counterpart — same operation order, same reseed cadence, same
5//! division points — so its output is byte-for-byte identical, verified by the
6//! `parity` tests. The window length is a const generic `N`; there is no runtime
7//! buffer and no allocation.
8
9mod atr;
10mod ema;
11mod roc;
12mod rsi;
13mod sma;
14
15pub use atr::Atr;
16pub use ema::Ema;
17pub use roc::Roc;
18pub use rsi::Rsi;
19pub use sma::Sma;
20
21/// The verified subset by name, in the order the C ABI and the docs list it.
22///
23/// One entry per module above. The test below pins the count, so an indicator
24/// added here without its parity test, its C ABI handle and its line in
25/// `docs/INDICATORS.md` shows up as a number that no longer matches.
26pub const CATALOGUE: &[&str] = &["Sma", "Ema", "Rsi", "Atr", "Roc"];
27
28#[cfg(test)]
29mod tests {
30 use super::CATALOGUE;
31
32 #[test]
33 fn total_count_matches_expected() {
34 // Bump together with new indicators. Drift between this number and
35 // the module list above is the early-warning signal that an indicator
36 // was added without being named in the catalogue.
37 let total = CATALOGUE.len();
38 assert_eq!(total, 5, "CATALOGUE total drifted from the indicator count");
39 assert!(CATALOGUE.windows(2).all(|w| w[0] != w[1]));
40 }
41}