pub trait RexType {
// Required method
fn rex_type() -> Type;
// Provided method
fn collect_rex_family(_out: &mut Vec<AdtDecl>) -> Result<(), TypeError> { ... }
}Expand description
Rust-side type metadata for values that can appear at a Rex boundary.
Implement this trait for any Rust type that appears in a typed host function
signature, a derived Rex ADT field, or other embedder-facing conversion
point. The returned Type is the Rex type that users see in signatures and
type errors.
Primitive Rust types such as integers, floats, bool, String, Vec<T>,
Option<T>, and Result<T, E> already implement RexType. For Rust structs
and enums that should be visible as Rex algebraic data types, prefer
#[derive(rex::Rex)], which implements both RexType and RexAdt.
Required Methods§
Provided Methods§
Sourcefn collect_rex_family(_out: &mut Vec<AdtDecl>) -> Result<(), TypeError>
fn collect_rex_family(_out: &mut Vec<AdtDecl>) -> Result<(), TypeError>
Append Rex ADT declarations required by this type to out.
The default implementation is intentionally empty, which is correct for
primitive and leaf types that do not introduce Rex ADT declarations.
Derived ADTs override this to collect declarations for the full acyclic
family reachable from Self and then append their own declaration.
Callers that register the family are responsible for ordering and validating the declarations before injection.
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.