Crate type_equalities[−][src]
Implements TypeEq
that can be passed around and used at runtime to safely coerce values,
references and other structures dependending on these types.
The equality type is zero-sized, and the coercion should optimize to a no-op in all cases.
This crate is ![no_std]
but still requires access to alloc
. This requirement might get
lifted in the future.
Modules
details | Details for primitively consuming an equality. |
type_functions |
|
Structs
TypeEq | Evidence of the equality |
Traits
IsEqual | Equality at a constraint level, as a type alias. Reflexivity holds. |
Functions
coerce | Coerce a value of type |
coerce_box | Coerce a value of type |
coerce_mut | Coerce a value of type |
coerce_ref | Coerce a value of type |
refl | Construct evidence of the reflexive equality |
substitute | Our workhorse for most of the other coerce implementations, lifting the equality through
an arbitrary |
trivial_eq | Construct evidence of |