pub fn parseFromSlice(
comptime T: type,
allocator: Allocator,
s: []const u8,
options: ParseOptions,
) ParseError(Scanner)!Parsed(T) T: typeallocator: Allocators: []const u8options: ParseOptions74
75
76
77
78
79
80
81
82
83
84pub fn parseFromSlice(
comptime T: type,
allocator: Allocator,
s: []const u8,
options: ParseOptions,
) ParseError(Scanner)!Parsed(T) {
var scanner = Scanner.initCompleteInput(allocator, s);
defer scanner.deinit();
return parseFromTokenSource(T, allocator, &scanner, options);
}
Parses the json document from
sand returns the result packaged in astd.json.Parsed. You must calldeinit()of the returned object to clean up allocated resources. If you are using astd.heap.ArenaAllocatoror similar, consider callingparseFromSliceLeakyinstead. Note thaterror.BufferUnderrunis not actually possible to return from this function.