summaryrefslogtreecommitdiff
path: root/engine-reflection/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-06-09 17:36:17 +0200
committerHampusM <hampus@hampusmat.com>2026-06-09 17:36:17 +0200
commitea95389b7fae4d75f3c8b6c465866834545ad5d9 (patch)
tree572df17feb33c5efd27f7fac493a1351e8459e3e /engine-reflection/src
parent62fe748a90efc35e9a5839b55b75a3db043102f1 (diff)
feat(engine): add offsets to reflection of enum variant fields
Diffstat (limited to 'engine-reflection/src')
-rw-r--r--engine-reflection/src/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/engine-reflection/src/lib.rs b/engine-reflection/src/lib.rs
index 53aa953..0382598 100644
--- a/engine-reflection/src/lib.rs
+++ b/engine-reflection/src/lib.rs
@@ -110,7 +110,11 @@ pub struct Field
pub name: Option<&'static str>,
pub index: usize,
pub layout: Layout,
- pub byte_offset: Option<usize>,
+
+ /// Byte offset to the field relative to the start of the type containing it. If the
+ /// type containing the field is a enum, this offset will include the enum tag
+ pub byte_offset: usize,
+
pub type_id: TypeId,
pub type_name: &'static str,
pub get_type: FnWithDebug<Option<&'static Type>>,