-
Notifications
You must be signed in to change notification settings - Fork 10
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
Derive Default #8
Comments
Sounds like a useful feature. I would love something like that for test data generation. As far as the The code that will be generated for ASN.1 input lives in |
On the A derivable randomness trait would be great. I guess most of the implementation would end up being on the |
|
Thank you for your issue! For the default feature, I agree with @6d7a that it should only be default when everything is specified to have a In regards to generating random structured data, I believe the recommended trait to derive would be |
It would be pretty useful to have an option to instruct the compiler to add the
Default
trait to the generated binding types, to help out in especially large ASN.1 definitions.This could be something similar to bindgen's
derive_default
.For enums we can default to the first enum choice, for constrained values we can default to the first value in the allowed interval, etc.,
I would be happy to help implement this :). However, the generate() functions currently only use the TLD as an argument, so I'm not sure of the best way to implement this. It should be in a way that allows several options, not only this proposed derive default.
The text was updated successfully, but these errors were encountered: