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 doc example for implementing BinRead #211

Closed
wants to merge 3 commits into from

Conversation

ScanMountGoat
Copy link
Contributor

Adds a slightly non trivial example for how to implement BinRead. I found that implementing BinRead for a generic type with the recent args changes was straightforward but not very obvious without examples.

@csnover
Copy link
Collaborator

csnover commented Aug 9, 2023

Hi, sorry about the delay. Wondering if it would be possible to do this example not using the FilePtrArgs type? It might be a silly thing to request since these are technically part of the public API but at the moment my gut says it isn’t a good idea to put examples in the docs that use these associated types that are only intended to be used with their parent class.

@ScanMountGoat
Copy link
Contributor Author

I can change it to use a custom args type like CustomPtr32Args with the same fields.

@ScanMountGoat
Copy link
Contributor Author

Do the latest changes look ok? @csnover

csnover added a commit to csnover/binrw that referenced this pull request Oct 26, 2023
csnover added a commit to csnover/binrw that referenced this pull request Oct 26, 2023
@ScanMountGoat
Copy link
Contributor Author

Any updates on this? @csnover

@ScanMountGoat
Copy link
Contributor Author

Does this look ok? @csnover

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.

2 participants