shaku
shaku copied to clipboard
Suggestion: provide an advanced sample project
I am new to Rust and I would have found very useful an advanced sample project showcasing every possible feature of shaku.
What I would like to have in this example is simultaneous use of Components and Providers, custom Components that create new instances using a static ::new() constructor and have dependencies on other Components and Providers. Something like:
impl<M: Module + HasComponent<dyn Logger>> Component<M> for DateLoggerImpl {
type Interface = dyn DateLogger;
type Parameters = ();
fn build(context: &mut ModuleBuildContext<M>, parameters: ()) -> Box<dyn DateLogger> {
Box::new(Self::new(context.build_component()))
}
}