Expand description
§reflect-derive
Proc macro crate providing #[derive(Reflect)].
Generates a reify_reflect_core::Reflect implementation that emits a
reify_reflect_core::RuntimeValue description of the type’s structural
shape:
- Named struct →
RuntimeValue::Listof(field_name_bytes, field_value)pairs. - Tuple struct →
RuntimeValue::Listof positional field values. - Unit struct (
struct X;) →RuntimeValue::Unit. - Empty named struct (
struct X {}) →RuntimeValue::List(vec![]). - Enum →
RuntimeValue::Listof variant entries, each(variant_name_bytes, variant_payload), where the payload mirrors the per-variant shape (unit / tuple / named).
Fields whose types implement Reflect<Value = RuntimeValue> are
reflected; fields annotated with #[reflect(skip)] are omitted.
Note: enum derivation reflects the type schema, not a runtime
instance. The generated reflect() is a static method (matching the
reify_reflect_core::Reflect trait), so it walks every variant and every
variant’s field types.
Derive Macros§
- Reflect
- Derives the
Reflecttrait for a struct or enum.