[−][src]Macro field_offset::offset_of
This macro allows safe construction of a FieldOffset, by generating a known to be valid lambda to pass to the constructor. It takes a type and the identifier of a field within that type as input.
Examples:
Offset of field Foo().bar
offset_of!(Foo => bar)
Offset of nested field Foo().bar.x
offset_of!(Foo => bar: Bar => x)