rust-bakery / nom

Rust parser combinator framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is the right way to parse chunk based file formats?

auronen opened this issue · comments

Hello,
what is the idiomatic way to parse chunk based binary formats (example)?
Is there a nice built-in way to pass in an extra self parameter, to accumulate the chunk contents into a struct instance?

For a chunk based file format that has only one level of chunk structure one could potentially parse the chunks as enum separately and then move the data to the instance of the struct. But the linked format has nested chunks and I have no idea how to approach this.