struct-field-offsets
This crate provides a field_offsets member over struct declaration
that adorns the FieldOffsets macro.
For example, this can be used in FFI scenarios where asserting the offset of each field among the various languages struct becomes a concern.
use FieldOffsets;
// at declaration site
// in the code
let offsets = field_offsets;
for in offsets
// prints:
// > field x offset is 0.
// > field y offset is 4.
// > field label offset is 8.
In your Cargo.toml:
[]
= "*"
Similar crates:
- Accessing field pointers:
- Retrieving the field count: const_field_count