Skip to content

Feature Request: Magic Numbers at end of File/Struct #274

@apps4uco

Description

@apps4uco

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions