type_expr

Function type_expr 

Source
pub fn type_expr<T: 'static>() -> TypeExpr
Expand description

Returns the best-effort TypeExpr for a Rust type T.

Resolution order:

  1. register_type::<T>(...)
  2. Built-in primitives and common shims (e.g. Vec<u8> as Bytes)
  3. Opaque("rust:<type_name>") fallback
use daedalus_data::typing::type_expr;
let ty = type_expr::<String>();
assert!(format!("{ty:?}").contains("String"));