summaryrefslogtreecommitdiff
path: root/engine-reflection/src/lib.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-06-11 18:07:35 +0200
committerHampusM <hampus@hampusmat.com>2026-06-11 18:07:35 +0200
commit2cd3d8fece9e2582abc6b6e70d94f28e3e0921bf (patch)
treeb0b0cdb014e4a5627f3678aa8fd210110258161c /engine-reflection/src/lib.rs
parent0918fd95082f3ad4837dec64e6c76d68f06da2fd (diff)
fix(engine): use std::any::type_name for field type name reflection
Diffstat (limited to 'engine-reflection/src/lib.rs')
-rw-r--r--engine-reflection/src/lib.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/engine-reflection/src/lib.rs b/engine-reflection/src/lib.rs
index c884edb..bad26df 100644
--- a/engine-reflection/src/lib.rs
+++ b/engine-reflection/src/lib.rs
@@ -127,13 +127,18 @@ pub struct Field
pub byte_offset: usize,
pub type_id: TypeId,
- pub type_name: &'static str,
+ pub get_type_name: FnWithDebug<&'static str>,
pub get_type: FnWithDebug<Option<&'static Type>>,
pub visibility: Visibility,
}
impl Field
{
+ pub fn type_name(&self) -> &'static str
+ {
+ self.get_type_name.get()
+ }
+
pub fn type_reflection(&self) -> Option<&'static Type>
{
self.get_type.get()