binrw icon indicating copy to clipboard operation
binrw copied to clipboard

after_parse API is underdefined and inconsistent

Open csnover opened this issue 4 years ago • 0 comments

The documentation makes it clear that read, read_args, or read_options are the correct calls to construct objects, but they don’t always construct fully-formed objects—only types generated by derive are guaranteed to call after_parse on their children (vs Vec<T>, [T;N], tuples, or other types that manually implement BinRead). Whether something was derived or not is an implementation detail which shouldn’t have extra side-effects like this. Most of the time it does not matter because most types do not use after_parse.

csnover avatar Mar 21 '21 15:03 csnover