WIP: Probably the wrong direction

This commit is contained in:
Nathan Sobo 2021-11-10 17:44:56 -07:00
parent 62ec105bff
commit 0fff7d9166
3 changed files with 190 additions and 72 deletions

View file

@ -31,6 +31,12 @@ pub trait Summary: Default + Clone + fmt::Debug {
pub trait Dimension<'a, S: Summary>: Clone + fmt::Debug + Default {
fn add_summary(&mut self, _summary: &'a S, _: &S::Context);
fn from_summary(summary: &'a S, cx: &S::Context) -> Self {
let mut dimension = Self::default();
dimension.add_summary(summary, cx);
dimension
}
}
impl<'a, T: Summary> Dimension<'a, T> for T {