You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there! I have a design-related question which I hope may eventually result in a contribution to enhance this codebase. This issue can be closed when maintainers have a consensus on whether or not this would be useful. :)
Recently, I've been developing some code in Rust that can parse Registry.pol files, and found it immensely useful to have a enum that models the data actually associated with registry values. It would be something along the lines of this:
The key benefit I see to this model is that it allows more specific and strong types for usage with the domain that this crate handles. This is especially useful for testing -- some of the code I might write to test a sample data file in my parser might like this, and I think it's pretty easy to follow:
This enum is not intended to replace the unparsed types like the RegValuestruct or the RegTypeenum -- but it would be convenient to users who don't need or intend to use the intermediate types. I already have conversions defined to this enum from sequences of bytes, which might be interesting to compare with the implementation that's in this project.
There are other details I would love to discuss, too -- but first, I want to know if this is even something interesting for the winreg crate's authors! I certainly thing it would be for users.
The text was updated successfully, but these errors were encountered:
Yes, I think this can be a part of winreg. When I started writing it I was thinking of a similar enum but ended up with RegValue struct just because it was easier to implement and I didn't need to actually use raw values anywhere outside of the crate.
Hey there! I have a design-related question which I hope may eventually result in a contribution to enhance this codebase. This issue can be closed when maintainers have a consensus on whether or not this would be useful. :)
Recently, I've been developing some code in Rust that can parse
Registry.pol
files, and found it immensely useful to have aenum
that models the data actually associated with registry values. It would be something along the lines of this:The key benefit I see to this model is that it allows more specific and strong types for usage with the domain that this crate handles. This is especially useful for testing -- some of the code I might write to test a sample data file in my parser might like this, and I think it's pretty easy to follow:
This
enum
is not intended to replace the unparsed types like theRegValue
struct
or theRegType
enum
-- but it would be convenient to users who don't need or intend to use the intermediate types. I already have conversions defined to thisenum
from sequences of bytes, which might be interesting to compare with the implementation that's in this project.There are other details I would love to discuss, too -- but first, I want to know if this is even something interesting for the
winreg
crate's authors! I certainly thing it would be for users.The text was updated successfully, but these errors were encountered: