lookup_tables/
axis.rs

1use std::marker::PhantomData;
2
3// todo: axis should specify the behavior at the bounds
4// interp
5// ZoH
6// clamp
7
8pub struct Axis<Indep, Search, LowerBound, UpperBound> {
9    _indep: PhantomData<Indep>,
10    _search: PhantomData<Search>,
11    _lower_bound: PhantomData<LowerBound>,
12    _upper_bound: PhantomData<UpperBound>,
13}
14
15// TODO: linear(), binary(), and cached() functions?
16impl<Indep, Search, LowerBound, UpperBound> Axis<Indep, Search, LowerBound, UpperBound> {
17    pub fn new() -> Self {
18        Self {
19            _indep: PhantomData,
20            _search: PhantomData,
21            _lower_bound: PhantomData,
22            _upper_bound: PhantomData,
23        }
24    }
25}
26
27pub trait AxisImpl {
28    type Indep;
29    type Search;
30    type LowerBound;
31    type UpperBound;
32}
33
34impl<Indep, Search, LowerBound, UpperBound> AxisImpl
35    for Axis<Indep, Search, LowerBound, UpperBound>
36{
37    type Indep = Indep;
38    type Search = Search;
39    type LowerBound = LowerBound;
40    type UpperBound = UpperBound;
41}