Crate reflectix

Source
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::field method
UnsizeableMut
Mutable reference holder, returned by TypeInfoDynamic::field_mut method
Variant
Variant of enum type
Variants

Enums§

Data
Information about data contained within type
FieldAccessError
If attempt to borrow field was incorrect
FieldId
Discriminant of particular field
Fields
Information about type fields (if there is any)
RuntimeConstructError
Failure of type construction

Traits§

TypeInfo
Static-type version of TypeInfoDynamic
TypeInfoDynamic
Object-safe version of TypeInfo

Derive Macros§

TypeInfo
Derive-able implementation of TypeInfo and TypeInfoDynamic