-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add custom parser support to Env provider #119
Comments
Yeah! That's totally useful. Please do! |
Great! I'll add proper documentation to the new Also, I was in doubt about what I did to the |
You can invoke the macro inside of a module to give the resulting items different namespaces: mod foo {
crate::util::cloneable_fn_trait!(..);
}
mod bar {
crate::util::cloneable_fn_trait!(..);
} |
I actually tried that before, but it didn't work because the trait is not public, so I'm thinking of just adding the pub option to the macro?
I actually just tried this, and it worked well, I'll create the PR as soon as I finish documenting the "parser" method. |
Just created the PR: #121 |
Hi! First of all, thanks for this awesome crate!
I wanted some flexibility in the format of the environment variable values when using the Env provider, so I did a little experiment, and it seems it would be easy to implement an option to setup a custom parser in the Env provider:
felipou@67e0551
It needs some work, but in the tests you can see how we could easily support YAML or JSON values for example, and it would be optional, without breaking compatibility.
Does this feature make sense? Should I polish it and create a pull request?
The text was updated successfully, but these errors were encountered: