Rust Internals
Get the offset of a field from the base of a struct
language design
Unsafe Code Guidelines
RalfJung
March 4, 2021, 9:32am
3
Until we have such a thing, the
memoffset crate
provides such a macro.
3 Likes
show post in topic
Related topics
Topic
Replies
Views
Activity
Computing raw pointers to fields
Unsafe Code Guidelines
3
4459
December 22, 2024
Discussion on offset_of!(..)
13
6387
February 2, 2019
Pre-RFC: Struct/union raw pointer field access
language design
11
2109
April 2, 2020
Pre-Pre-RFC: Field offsets
language design
7
1754
March 25, 2019
Raw pointer field projection
5
1521
May 29, 2021