onenote_parser-macros 2.0.0

Internal derive macros used by onenote_parser for binary parsing
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 11.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 139.88 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • msiemens/onenote.rs
    84 23 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • msiemens

Internal proc-macro support crate for onenote_parser.

This crate provides #[derive(Parse)], which is used by the parser's low-level OneStore/OneNote decoding types to reduce handwritten binary parsing boilerplate.

It is intended for internal use inside this workspace. Most users should use the high-level onenote_parser crate API instead of depending on this crate directly.

The derive generates an implementation of crate::onestore::desktop::parse::Parse for a struct by parsing each field in declaration order from a shared reader.

Supported attributes

  • #[validate(expr)] (struct-level): Runs after field parsing and returns ParseValidationFailed when expr evaluates to false.
  • #[assert_offset(n)] (field-level): Validates that a field starts at byte offset n from the start of the struct.
  • #[pad_to_alignment(n)] (field-level): Advances the reader by up to n - 1 bytes after parsing a field to align subsequent parsing.
  • #[parse_additional_args(args)] (field-level): Passes extra arguments to a field type's ::parse(...) call.

Scope and limitations

  • Only named-field structs are currently implemented.
  • Tuple structs, unit structs, enums, and unions are not yet supported.