pub unsafe trait Facet<'a>: Sized + 'a {
const SHAPE: &'static Shape;
// Provided method
fn type_eq<Other>() -> bool
where Other: Facet<'a> { ... }
}Expand description
Allows querying the Shape of a type, which in turn lets us inspect any fields, build a value of
this type progressively, etc.
§Safety
If you implement this wrong, all the safe abstractions in facet-reflect,
all the serializers, deserializers, the entire ecosystem is unsafe.
You’re responsible for describing the type layout properly, and annotating all the invariants.
Required Associated Constants§
Provided 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.