template_builder/template.rs
1pub trait Template {
2 type Output;
3
4 fn define(self) -> <Self as Template>::Output;
5}
6
7pub trait TemplateConstruction: /*FnOnce() + */ Default + Template {
8 fn on_create(&mut self, f: impl FnOnce(&mut Self::Output) + 'static);
9 fn create(self) -> Self::Output;
10 fn build<O>(self, f: impl FnOnce(Self::Output) -> O) -> O;
11}
12
13pub trait Templatable {
14 type New: Template<Output = Self>;
15}