Macro memoffset::offset_of_tuple

source ·
macro_rules! offset_of_tuple {
    ($parent:ty, $field:tt) => { ... };
}
Expand description

Calculates the offset of the specified field from the start of the tuple.

§Examples

use memoffset::offset_of_tuple;

fn main() {
    assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout");
}