Expand description
Crate for primitive run-time type reflection
Information is generated entirely in compile-time using derive macro TypeInfo
Moreover, this crate mostly itends to operate with trait objects and std::any::Any.
That’s why there are two separate “main” traits: TypeInfo and TypeInfoDynamic.
The former indents to provide info about type when the type can be named and is known and the latter is for case if type is erased
§Examples
use reflectix::TypeInfoDynamic;
#[derive(reflectix::TypeInfo, Default)]
struct Foo{
bar: i32
}
let foo_erased = &foo;
assert_eq!(foo.get_dynamic().ident, "Foo");
Structs§
- Field
- Field of type
- Type
- Information about type
- Unsizeable
- Immutable reference holder, returned by
TypeInfoDynamic::fieldmethod - Unsizeable
Mut - Mutable reference holder, returned by
TypeInfoDynamic::field_mutmethod - Variant
- Variant of enum type
- Variants
Enums§
- Data
- Information about data contained within type
- Field
Access Error - If attempt to borrow field was incorrect
- FieldId
- Discriminant of particular field
- Fields
- Information about type fields (if there is any)
- Runtime
Construct Error - Failure of type construction
Traits§
- Type
Info - Static-type version of
TypeInfoDynamic - Type
Info Dynamic - Object-safe version of
TypeInfo
Derive Macros§
- Type
Info - Derive-able implementation of
TypeInfoandTypeInfoDynamic