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 of type
- Information about type
- Immutable reference holder, returned by
TypeInfoDynamic::field
method - Mutable reference holder, returned by
TypeInfoDynamic::field_mut
method - Variant of enum type
Enums§
- Information about data contained within type
- If attempt to borrow field was incorrect
- Discriminant of particular field
- Information about type fields (if there is any)
- Failure of type construction
Traits§
- Static-type version of
TypeInfoDynamic
- Object-safe version of
TypeInfo
Derive Macros§
- Derive-able implementation of
TypeInfo
andTypeInfoDynamic