irox_stats/
pyramid.rs

1// SPDX-License-Identifier: MIT
2// Copyright 2024 IROX Contributors
3//
4
5use crate::streaming::{Max, Mean, Min};
6use alloc::collections::BTreeMap;
7use core::marker::PhantomData;
8
9pub struct ResolutionExponent(pub i8);
10
11pub struct Cell<K, V> {
12    pub base2_exponent: i8,
13    pub start_inclusive: K,
14    pub end_exclusive: K,
15    pub min: Min<V>,
16    pub max: Max<V>,
17    pub mean: Mean<V>,
18}
19
20pub struct TimePyramidLevel<K, V> {
21    pub exponent: i8,
22    pub level_data: BTreeMap<K, V>,
23}
24
25pub struct TimePyramidMap<K, V> {
26    pub data: BTreeMap<i8, TimePyramidLevel<K, V>>,
27    _phan: PhantomData<V>,
28}