Not to get into specifics but essentially, I am building a web server in zig, and would like to get the struct type at runtime, basically I don’t want the user of the web server to have to build there own jsonParser for every struct they may want to store in a DB, and so at runtime I need the type for it to be parsed from json into the specified struct type. In essence, basically a json parser function that returns the parsed value, which operates at runtime.
I have tried to use the @field(Struct, “field_name”) to access the type, but this can only be used at compile time 🙁
Vic-August Rokx-Nellemann is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.