OxL Reference

data FieldInfo

Comptime description of a field of a data type, a tuple or an enum variant.

Example:

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

@derive(Copy)
data Sample {
  @tag(5) id: i32
  plain: i32
}

fn main() io {
  inline for f in reflect(Sample).fields {
    print("{f.name} tag={f.tag} attrs={f.attrs.len}")
  }
}
Output
id tag=5 attrs=1
plain tag=6 attrs=0
pub(api) data FieldInfo

Since. 1.0.0-beta

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

See also