global: snapshot

This commit is contained in:
nym21
2026-03-07 20:54:28 +01:00
parent 2df549f1f8
commit ee59731ed2
33 changed files with 419 additions and 390 deletions
@@ -1,30 +0,0 @@
use brk_traversable::Traversable;
#[derive(Clone, Traversable)]
pub struct Emas1w1m<A> {
#[traversable(rename = "1w")]
pub _1w: A,
#[traversable(rename = "1m")]
pub _1m: A,
}
impl<A> Emas1w1m<A> {
pub const SUFFIXES: [&'static str; 2] = ["ema_1w", "ema_1m"];
pub fn try_from_fn<E>(
mut f: impl FnMut(&str) -> std::result::Result<A, E>,
) -> std::result::Result<Self, E> {
Ok(Self {
_1w: f(Self::SUFFIXES[0])?,
_1m: f(Self::SUFFIXES[1])?,
})
}
pub fn as_array(&self) -> [&A; 2] {
[&self._1w, &self._1m]
}
pub fn as_mut_array(&mut self) -> [&mut A; 2] {
[&mut self._1w, &mut self._1m]
}
}
@@ -1,9 +1,7 @@
mod distribution_stats;
mod emas;
mod per_period;
mod windows;
pub use distribution_stats::*;
pub use emas::*;
pub use per_period::*;
pub use windows::*;