NEOLearn

Reflection examples

The engine's reflection examples: what each one shows, whether it runs in a browser and the command that runs it.

Updated October 20, 2026

On this page

Reflecting types at runtime, the type registry, dynamic types and serialization. There are 10 examples on this page. For the concepts behind them, see Reflection.

Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.

Examples#

ExampleWhat it showsWebRun
Automatic types registrationDemonstrates how to set up automatic reflect types registration for platforms without inventory supportNocargo run --example auto_register_static
Custom AttributesRegistering and accessing custom attributes on reflected typesNocargo run --example custom_attributes
Dynamic TypesHow dynamic types are used with reflectionNocargo run --example dynamic_types
Function ReflectionDemonstrates how functions can be called dynamically using reflectionNocargo run --example function_reflection --features reflect_functions
Generic ReflectionRegisters concrete instances of generic types that may be used with reflectionNocargo run --example generic_reflection
Mutation by ReflectionDemonstrates how to mutate abstract or non-Rust data at runtime using reflectionNocargo run --example mutation_by_reflection
ReflectionDemonstrates how reflection in NEO provides a way to dynamically interact with Rust typesNocargo run --example reflection
Reflection TypesIllustrates the various reflection types availableNocargo run --example reflection_types
SerializationDemonstrates serialization and deserialization using reflection without serde's Serialize/Deserialize traitsNocargo run --example serialization
Type DataDemonstrates how to create and use type dataNocargo run --example type_data

See also#