pub fn struct_from_jsonvalue(v: const JsonValue, struct_kt: integer) -> JsonValue
Internal walker — populate a struct of the given struct_kt (known-type number) from a JsonValue. Compile-time codegen for Struct.parse(JsonValue) emits exactly one call to this function regardless of struct shape; the runtime walker uses stores.types[struct_kt].parts to dispatch on each field's declared type (primitive, nested struct, JsonValue passthrough, or vector). Path-qualified schema-side diagnostics on type mismatches go to json_errors(). Users should not call this directly — write MyStruct.parse(value) instead.
Return type is declared as JsonValue here purely because it shares the same DbRef byte layout as the actual reference[T] the walker produces — the compile-time codegen at parse_type_parse overrides the type to reference[T] for the caller while the stack accounting remains correct.
pub fn struct_to_json(self_ref: const JsonValue, struct_kt: integer) -> text
Serialise any user struct to canonical JSON (RFC 8259) — what instance.to_json() calls. Text fields are escaped (" / \ / control bytes); nested structs and vectors recurse; a JsonValue-typed field renders its subtree as it is.
pub fn struct_to_json_pretty(self_ref: const JsonValue, struct_kt: integer) -> text
As struct_to_json but produces a pretty (2-space-indent, one element per line) form. Same field-type matrix.