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

Add bound attribute to restrict derived impls #341

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MegaBluejay
Copy link

Analogous to serde's

This allows using generics without restricting them in the struct definition

The use-case for me is parsing into a raw form, then post-processing some fields, while retaining most of the structure. With this both can use the same generic type, and only the raw form needs to implement DekuRead/DekuWrite.

Inferring the bounds automatically would be better, but I'm not up to writing that right now.

Copy link
Collaborator

@wcampbell0x2a wcampbell0x2a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add documentation to src/attributes.rs? Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants