Skip to documentation
SLOP

tiny.preserves.fromJsonString

Reference tiny.preserves fromJsonString

Defined in json.

Parses json_text and returns the Preserves value it describes, allocated with alloc, for code that receives JSON text.

Called byCallsprivate sourcelib.preserves.src.jsoncheckEmbeddedJsonAllocationFailurestest sourcelib.preserves.src.jsontest: $capture / $bind / $rest round-...test sourcelib.preserves.src.jsontest: fromJsonString: discard rou...test sourcelib.preserves.src.jsontest: fromJsonString: embedded pa...test sourcelib.preserves.src.jsontest: fromJsonString: record roun...+6 moreprivate sourcelib.preserves.src.jsonjsonToValuejsonfromJsonString
Static calls · unresolved targets: 0 · external targets: 1.

Source

Source: lib/preserves/src/json.zig:293

zig
/// Parses `json_text` and returns the Preserves value it describes, allocated with `alloc`, for/// code that receives JSON text. The value owns all its memory, and the caller frees it with/// `deinit`. The mapping is the one `fromJsonValue` applies to the parsed JSON. Malformed JSON/// returns `error.OutOfMemory`, the only error the call reports. If memory runs out inside a/// `__record__`, `$rest`, `$capture`, `$bind` or `"type"` object, the call leaks the parts already/// built.pub fn fromJsonString(alloc: Allocator, json_text: []const u8) !Value {    const parsed = std.json.parseFromSlice(std.json.Value, alloc, json_text, .{}) catch return error.OutOfMemory;    defer parsed.deinit();    return jsonToValue(alloc, parsed.value);}

Source: lib/preserves/src/root.zig:305

zig
pub const fromJsonString = json.fromJsonString;

Complete caller list

11 direct callers.

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433