-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement the base of a TBF Parser #7
Conversation
and allowed redundant field names
Update 1I have made the footer parser work without static-lifetime byte slices. The 'try_into` implementation was a bit more annoying to get right, but what I did boils down to explicitly allowing casting only in the case where the byte array lives longer than the Footer. ProposalI did have an idea though, I could split off the different footer types (sha256, etc.) into their own structs with a fixed-sized slice. If we know we have a Sha256 footer we also know the u8 slice needs to be 32 long. And so on. This way, no need to worry about lifetimes, we just take ownership of the data. And if we do go this route, we could also enforce a maximum size limit on the package name (say 256 bytes) and we would have no lifetime limitations, we could ditch the original data altogether after parsing the footer. What do you people think? Details for commit here: e989e86 Update 2I have fixed the clippy warnings, some were trivial like unnecessary casting, or replacing Details here: 5f5fcf2 In these two updates, I have achieved most of what I wanted, I believe I have a pretty robust base down for the tbf-parser. I'm opening this up for review. |
In the meantime I have worked on my previous proposal, and managed to get the TBF Header to fully own all of its data, meaning the original data can be abandoned altogether after parsing. This does however come at the cost of increased size in RAM for both the header and the footer. |
In this PR, I am aim to implement a basic parser based on the one from tock-tbf. I want this to be a base to work off of in the future, as tockloader-rs is being developed.
To sum up briefly what I have done in this PR:
TODO: