jam1garner / binrw

A Rust crate for helping parse and rebuild binary data using ✨macro magic✨.
https://binrw.rs
MIT License
585 stars 35 forks source link

Support try on struct level #180

Closed mpe85 closed 1 year ago

mpe85 commented 1 year ago

Would it be possible to support the try attribute on struct level, so that it is applied to all fields inside the struct? I have a lot of structs where all fields have the try attribute, so it would be very neat to have this possibility. Thanks.

csnover commented 1 year ago

Hi! Sorry about missing this until now, I have had some issues with GH notifications and this slipped by. If you are still interested in this feature, are you able to say a little more about the data format you are parsing where all the fields in a struct may not exist? It is possible to add a struct-level directive but it is also possible that there might be different solution that works better.

csnover commented 1 year ago

Hi! I’m going to close this issue for now due to non-response. Apologies again about the delay. If you still would like to see this feature in future, please reply any time with the requested information and it can be reopened. Thanks!