pub trait Reflect {
type Value;
// Required method
fn reflect() -> Self::Value;
}Expand description
Converts a type-level value into a runtime value.
Types implementing Reflect carry a compile-time value that can be
extracted at runtime via Reflect::reflect.
§Examples
use reify_reflect_core::{Reflect, RuntimeValue};
struct MyZero;
impl Reflect for MyZero {
type Value = RuntimeValue;
fn reflect() -> Self::Value {
RuntimeValue::Nat(0)
}
}
assert_eq!(MyZero::reflect(), RuntimeValue::Nat(0));Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.