import ddn.var;
var m; m["a"] = 1; m["b"] = 2;
auto s = ddn.data.json5.toJSON5(m); // "{a:1,b:2}"toJSON5
Serialize a var to JSON5 text using the provided opts.
Notes:
- This function allocates while building the resulting
stringand is not
@nogc.
Examples
fn
string toJSON5(const var value, const Json5WriteOptions opts, ref Json5WriteScratch scratch) @safeSerialize a var to JSON5 text using the provided opts and reusable scratch buffers.
This overload allows callers to reuse temporary key-sorting buffers across repeated serializations to reduce allocations.