Feature Request: Magic Numbers at end of File/Struct
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 853
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
Hi, some formats, eg Parquet have a Magic Number at the end of the file, also others have them at the end of headers eg Zstd Skippable Frames.
Although it is possible to define a struct like this
```
...
#[brw(magic = 0x8F92EAB1_u32)]
pub dummy: (),
}
```
however, it feels like a bit clunky.
Would it be possible to either support the following
```
...
#[brw(magic = 0x8F92EAB1_u32)]
}
```
or (maybe better for documentation purposes)
```
#[brw(end_magic = 0x184D2A5E_u32, little)]
pub struct MyStruct {
```
This would then allow a format to have start and end magic numbers.
```
#[brw(magic = 0x184D2A5E_u32,end_magic = 0x184D2A5E_u32, little)]
pub struct MyStruct {
```
Thanks for the excellent crate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing how the existing `magic` attribute is parsed and applied, then determine the intended syntax and behavior for validating a magic number at the end of a struct while preserving support for start and end markers. Done means the chosen API is implemented with coverage for the requested binary-format cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- reverse-engineering
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100