Expand description
Object reflection: look up the methods, fields and type attributes of
registered types; register Rust object types with ObjectDef, type
attributes with TypeAttrDef and enum values with EnumDef; call the
typed hooks that attributes hold with NativeFunction.
Structs§
- Access
Path - A path from a root value to a nested one, such as
root.field[0], as a chain of parents; its methods are reached withreflection::get_method. - Access
Path Obj - The object behind an
AccessPath, laid out as the C++AccessPathObj. - Access
Step - One step of an
AccessPath: an attribute, array index or map key. - Access
Step Obj - The object behind an
AccessStep, laid out as the C++AccessStepObj. - Enum
Attr Map - One attribute of the values of the enum type
E, asV, returned byEnumRef::attr_map. - EnumDef
- Registers a value of the enum type
E, then its attributes. - Field
Flags - The reflection flags of one field, combined with
|. - Field
Getter - Resolves a reflected field once, then uses its registered C ABI getter.
- Native
Function - A typed hook that a type attribute, an enum attribute or another registry
slot holds: a native function, called directly through the C ABI, or a
packed
Functionregistered in its place. - Object
Def - Registers the reflection of the object type
N: the metadata, each#[reflect]field, the methods and the type attributes. - Type
Attr Column - A registry-owned type-attribute column indexed by runtime type.
- Type
Attr Def - Registers type attributes of the object type
T, each as soon asset_attrnames it, for every language to read withTypeAttrColumn.
Enums§
- Access
Kind - What an
AccessStepaccesses: an attribute, an array item or a map item, or one of those that is missing. - SEqHash
Kind - How the structural engines treat instances of a type.
Traits§
- Native
Args - The argument tuples a
NativeFunctiontakes: up to eight borrowed objects, managed references orAnyvalues. - Shallow
Copy - A copy of an object’s own fields under a fresh object header, which
__ffi_shallow_copy__returns; fields that are references share their objects, asCloneof anArcdoes. - Unsafe
Init - An object type whose object can start with every field undefined, for reflection to set the fields.
Functions§
- field_
default - The default value
Tregisters for its fieldname, orNoneifTregisters no such field, the field has no default, or its default comes from a factory. - get_
method - Look up a reflected method of a type by type key and method name.
- get_
method_ by_ index - Look up a reflected method of a type by type index and method name, as
get_methoddoes by type key. - type_
key - The type key registered for
type_index, such as"ffi.Array", orNoneif no type has that index. - unsafe_
init ⚠ - An object of
Twith every field undefined, zero-filled, for reflection to set the fields through their setters.