OxL Reference

data TypeInfo

Comptime description of a type (reflect(T)).

Example:

oxl✓ checked in CI
use std.reflect { reflect, TypeInfo }

data User {
  id: i64
  name: str
}

fn main() io {
  print("{reflect(User).name} has {reflect(User).fields.len} fields")
  inline for f in reflect(User).fields {
    print("  {f.name}: {f.type.name}")
  }
}
Output
User has 2 fields
  id: i64
  name: str
pub(api) data TypeInfo

Since. 1.0.0-beta

Defined in: std/reflect/reflect.oxl:52

See also