pub fn valueAlloc(gpa: Allocator, v: anytype, options: Options) error
Calls value and stores the result in dynamically allocated memory instead of taking a writer.
value
Caller owns returned memory.
gpa: Allocator
v
options: Options
618 619 620 621 622 623
pub fn valueAlloc(gpa: Allocator, v: anytype, options: Options) error{OutOfMemory}![]u8 { var aw: Writer.Allocating = .init(gpa); defer aw.deinit(); value(v, options, &aw.writer) catch return error.OutOfMemory; return aw.toOwnedSlice(); }
Calls
valueand stores the result in dynamically allocated memory instead of taking a writer.Caller owns returned memory.