Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: provide an advanced sample project #9

Open
leinardi opened this issue Dec 9, 2020 · 0 comments
Open

Suggestion: provide an advanced sample project #9

leinardi opened this issue Dec 9, 2020 · 0 comments

Comments

@leinardi
Copy link

leinardi commented Dec 9, 2020

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()))
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant