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
Support for dependency's field injection. #1
Comments
In the above example, there are 3 things worth noting.
|
Thanks for your reply, I can understand the things you list, my understanding was also the same as you when I first raised the issue.
In my imagine with this thing: #[derive(Debug)]
struct Bar(Config);
#[Transient(binds = [Self::into_debug])] // Bind the implementation of the `Debug` trait and the trait object of the `Debug` trait
impl Bar {
async fn new(#[di(name = "config")] config: Config) -> Bar { // Register async constructor
Bar(config.max_user)
}
} |
All instances stored in the |
When inject a specific field from a struct, for example, I think it would be better to code like this:
The text was updated successfully, but these errors were encountered: