shaku icon indicating copy to clipboard operation
shaku copied to clipboard

Suggestion: provide an advanced sample project

Open leinardi opened this issue 5 years ago • 0 comments

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()))
    }
}

leinardi avatar Dec 09 '20 10:12 leinardi