Function allocNextIntoArrayListMax [src]

Calls std.json.Scanner.allocNextIntoArrayListMax and handles error.BufferUnderrun.

Prototype

pub fn allocNextIntoArrayListMax(self: *@This(), value_list: *std.array_list.Managed(u8), when: AllocWhen, max_value_len: usize) Reader.AllocError!?[]const u8

Parameters

self: *@This()value_list: *std.array_list.Managed(u8)when: AllocWhenmax_value_len: usize

Possible Errors

EndOfStream Error
OutOfMemory Error
ReadFailed Error

See the Reader implementation for detailed diagnostics.

SyntaxError Error
UnexpectedEndOfInput Error
ValueTooLong

Source

pub fn allocNextIntoArrayListMax(self: *@This(), value_list: *std.array_list.Managed(u8), when: AllocWhen, max_value_len: usize) Reader.AllocError!?[]const u8 { while (true) { return self.scanner.allocNextIntoArrayListMax(value_list, when, max_value_len) catch |err| switch (err) { error.BufferUnderrun => { try self.refillBuffer(); continue; }, else => |other_err| return other_err, }; } }