strafe_trait/
assumption.rs

1use std::{any::TypeId, fmt::Debug};
2
3use crate::{Concept, Normal, NormalResiduals, NotNormal, NotNormalResiduals};
4
5pub trait Assumption: Debug + Concept {
6    fn to_comparator(&self) -> TypeId
7    where
8        Self: 'static,
9    {
10        self.comparator()
11    }
12}
13
14impl dyn Assumption {
15    pub fn is<C: 'static + Concept>(&self) -> bool {
16        self.comparator() == C::new().comparator()
17    }
18}
19
20impl Assumption for Normal {}
21
22impl Assumption for NotNormal {}
23
24impl Assumption for NormalResiduals {}
25
26impl Assumption for NotNormalResiduals {}