Skip to documentation
SLOP

tiny.pretty.json

Reference tiny.pretty json

Defined in tiny.pretty.

Deterministic JSON escaping, tree rendering, and allocation-free streaming.

API (78)

Actions

Public operations.

Types and contracts

Public types and contracts.

No direct callersNo direct callstiny.prettyjson
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/pretty/core/src/json/field.zig:5

zig
pub const Field = struct {    first: bool = false,};

Source: lib/pretty/core/src/json/format.zig:3

zig
pub const Style = enum {    minified,    indent_2,};

Source: lib/pretty/core/src/json/stream.zig:143

zig
/// An open array scope on one `Writer`./// Nested scopes share the writer and must end before their parent continues.pub const Array = struct {    writer: *Writer,    pub fn element(self: Array, value: anytype) !void {        try self.writer.write(value);    }    pub fn object(self: Array) !Object {        return try self.writer.object();    }    pub fn array(self: Array) !Array {        return try self.writer.array();    }    pub fn stringParts(self: Array, parts: []const []const u8) !void {        try self.writer.stringParts(parts);    }    pub fn byteString(self: Array, bytes: []const u8) !void {        try self.writer.byteString(bytes);    }    pub fn hexString(self: Array, bytes: []const u8) !void {        try self.writer.hexString(bytes);    }    pub fn base64String(self: Array, bytes: []const u8) !void {        try self.writer.base64String(bytes);    }    pub fn formattedString(        self: Array,        comptime capacity: usize,        comptime fmt: []const u8,        args: anytype,    ) !void {        try self.writer.formattedString(capacity, fmt, args);    }    pub fn raw(self: Array, value: []const u8) !void {        try self.writer.raw(value);    }    pub fn print(self: Array, comptime fmt: []const u8, args: anytype) !void {        try self.writer.print(fmt, args);    }    pub fn end(self: Array) !void {        try self.writer.endArray();    }    pub fn endLine(self: Array) !void {        try self.end();        try self.writer.newline();    }};

Source: lib/pretty/core/src/json/stream.zig:7

zig
/// An open object scope on one `Writer`./// Nested scopes share the writer and must end before their parent continues.pub const Object = struct {    writer: *Writer,    pub fn field(self: Object, name: []const u8, value: anytype) !void {        try self.writer.objectField(name);        try self.writer.write(value);    }    pub fn fields(self: Object, values: anytype) !void {        const info = switch (@typeInfo(@TypeOf(values))) {            .@"struct" => |value| value,            else => @compileError("JSON object fields require a named struct"),        };        if (info.is_tuple) {            @compileError("JSON object fields require a named struct");        }        inline for (info.field_names) |name| {            try self.field(name, @field(values, name));        }    }    pub fn fieldParts(        self: Object,        name_parts: []const []const u8,        value: anytype,    ) !void {        try self.writer.objectFieldParts(name_parts);        try self.writer.write(value);    }    pub fn formattedField(        self: Object,        comptime capacity: usize,        comptime fmt: []const u8,        args: anytype,        value: anytype,    ) !void {        var buffer: [capacity]u8 = undefined;        const name = try std.fmt.bufPrint(&buffer, fmt, args);        try self.field(name, value);    }    pub fn object(self: Object, name: []const u8) !Object {        try self.writer.objectField(name);        return try self.writer.object();    }    pub fn formattedObject(        self: Object,        comptime capacity: usize,        comptime fmt: []const u8,        args: anytype,    ) !Object {        var buffer: [capacity]u8 = undefined;        const name = try std.fmt.bufPrint(&buffer, fmt, args);        return try self.object(name);    }    pub fn array(self: Object, name: []const u8) !Array {        try self.writer.objectField(name);        return try self.writer.array();    }    pub fn formattedArray(        self: Object,        comptime capacity: usize,        comptime fmt: []const u8,        args: anytype,    ) !Array {        var buffer: [capacity]u8 = undefined;        const name = try std.fmt.bufPrint(&buffer, fmt, args);        return try self.array(name);    }    pub fn stringParts(        self: Object,        name: []const u8,        parts: []const []const u8,    ) !void {        try self.writer.objectField(name);        try self.writer.stringParts(parts);    }    pub fn byteString(self: Object, name: []const u8, bytes: []const u8) !void {        try self.writer.objectField(name);        try self.writer.byteString(bytes);    }    pub fn hexString(self: Object, name: []const u8, bytes: []const u8) !void {        try self.writer.objectField(name);        try self.writer.hexString(bytes);    }    pub fn base64String(self: Object, name: []const u8, bytes: []const u8) !void {        try self.writer.objectField(name);        try self.writer.base64String(bytes);    }    pub fn formattedString(        self: Object,        name: []const u8,        comptime capacity: usize,        comptime fmt: []const u8,        args: anytype,    ) !void {        try self.writer.objectField(name);        try self.writer.formattedString(capacity, fmt, args);    }    pub fn raw(self: Object, name: []const u8, value: []const u8) !void {        try self.writer.objectField(name);        try self.writer.raw(value);    }    pub fn print(        self: Object,        name: []const u8,        comptime fmt: []const u8,        args: anytype,    ) !void {        try self.writer.objectField(name);        try self.writer.print(fmt, args);    }    pub fn end(self: Object) !void {        try self.writer.endObject();    }    pub fn endLine(self: Object) !void {        try self.end();        try self.writer.newline();    }};

Source: lib/pretty/core/src/json/stream.zig:203

zig
/// Streams one JSON value at a time without intermediate string allocations./// `newline` resets completed top-level state so the same writer can emit JSONL.pub const Writer = struct {    stringify: std.json.Stringify,    pub fn init(writer: *std.Io.Writer, style: format.Style) Writer {        return .{ .stringify = .{            .writer = writer,            .options = format.stringifyOptions(style),        } };    }    pub fn beginObject(self: *Writer) !void {        try self.stringify.beginObject();    }    pub fn object(self: *Writer) !Object {        try self.beginObject();        return .{ .writer = self };    }    pub fn endObject(self: *Writer) !void {        try self.stringify.endObject();    }    pub fn objectField(self: *Writer, name: []const u8) !void {        try self.stringify.objectField(name);    }    fn objectFieldParts(self: *Writer, parts: []const []const u8) !void {        try self.stringify.beginObjectFieldRaw();        try escape.writeStringParts(self.stringify.writer, parts);        self.stringify.endObjectFieldRaw();    }    pub fn beginArray(self: *Writer) !void {        try self.stringify.beginArray();    }    pub fn array(self: *Writer) !Array {        try self.beginArray();        return .{ .writer = self };    }    pub fn endArray(self: *Writer) !void {        try self.stringify.endArray();    }    pub fn write(self: *Writer, value: anytype) !void {        try self.stringify.write(value);    }    pub fn stringParts(self: *Writer, parts: []const []const u8) !void {        const raw_writer = try self.beginRaw();        try escape.writeStringParts(raw_writer, parts);        self.endRaw();    }    pub fn byteString(self: *Writer, bytes: []const u8) !void {        const raw_writer = try self.beginRaw();        try escape.writeByteString(raw_writer, bytes);        self.endRaw();    }    pub fn hexString(self: *Writer, bytes: []const u8) !void {        const hex = "0123456789abcdef";        const raw_writer = try self.beginRaw();        try raw_writer.writeByte('"');        for (bytes) |byte| {            try raw_writer.writeByte(hex[byte >> 4]);            try raw_writer.writeByte(hex[byte & 0x0f]);        }        try raw_writer.writeByte('"');        self.endRaw();    }    pub fn base64String(self: *Writer, bytes: []const u8) !void {        const raw_writer = try self.beginRaw();        try raw_writer.writeByte('"');        try std.base64.standard.Encoder.encodeWriter(raw_writer, bytes);        try raw_writer.writeByte('"');        self.endRaw();    }    pub fn formattedString(        self: *Writer,        comptime capacity: usize,        comptime fmt: []const u8,        args: anytype,    ) !void {        if (capacity == 0) @compileError("formatted JSON string capacity must be positive");        var buffer: [capacity]u8 = undefined;        try self.write(try std.fmt.bufPrint(&buffer, fmt, args));    }    pub fn raw(self: *Writer, value: []const u8) !void {        try self.stringify.beginWriteRaw();        try self.stringify.writer.writeAll(value);        self.stringify.endWriteRaw();    }    pub fn beginRaw(self: *Writer) !*std.Io.Writer {        try self.stringify.beginWriteRaw();        return self.stringify.writer;    }    pub fn endRaw(self: *Writer) void {        self.stringify.endWriteRaw();    }    pub fn print(self: *Writer, comptime fmt: []const u8, args: anytype) !void {        try self.stringify.print(fmt, args);    }    pub fn newline(self: *Writer) !void {        try self.stringify.writer.writeByte('\n');        if (self.stringify.indent_level != 0) return;        if (self.stringify.next_punctuation != .comma) return;        self.stringify = .{            .writer = self.stringify.writer,            .options = self.stringify.options,        };    }};

Source: lib/pretty/core/src/json/document.zig:25

zig
pub fn renderValueAlloc(    allocator: std.mem.Allocator,    value: std.json.Value,    options: LayoutOptions,) ![]u8 {    var arena_state = std.heap.ArenaAllocator.init(allocator);    defer arena_state.deinit();    const builder = Builder.init(arena_state.allocator());    return try pretty.renderAlloc(allocator, try valueDoc(builder, value), options);}
Called byCallstest sourcelib.pretty.core.src.json.documenttest: valueDoc renders grouped JSON v...jsonvalueDocjsonrenderValueAlloc
Static calls · unresolved targets: 1 · external targets: 3.

Source: lib/pretty/core/src/json/document.zig:12

zig
pub fn valueDoc(builder: Builder, value: std.json.Value) anyerror!Doc {    return switch (value) {        .null => try builder.styledText(.keyword, "null"),        .bool => |item| try builder.styledText(.keyword, if (item) "true" else "false"),        .integer => |item| try builder.styledFmt(.number, "{d}", .{item}),        .float => |item| try builder.styledFmt(.number, "{d}", .{item}),        .number_string => |item| try builder.styledText(.number, item),        .string => |item| try builder.styledText(.string, try escape.stringAlloc(builder.allocator, item)),        .array => |items| try arrayDoc(builder, items.items),        .object => |object| try objectDoc(builder, object),    };}
Called byCallsprivate sourcelib.pretty.core.src.json.documentarrayDocprivate sourcelib.pretty.core.src.json.documentobjectDocjsonrenderValueAllocjsonwriteValueWithStateprivate sourcelib.pretty.core.src.json.documentarrayDocprivate sourcelib.pretty.core.src.json.documentobjectDocjsonstringAllocjsonvalueDoc
Static calls · unresolved targets: 0 · external targets: 2.

Source: lib/pretty/core/src/json/document.zig:36

zig
pub fn writeValue(    writer: anytype,    allocator: std.mem.Allocator,    value: std.json.Value,    options: LayoutOptions,) !void {    try writeValueWithState(writer, allocator, value, options, .{});}
Called byCallsNo direct callersjsonwriteValueWithStatejsonwriteValue
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/document.zig:45

zig
pub fn writeValueWithState(    writer: anytype,    allocator: std.mem.Allocator,    value: std.json.Value,    options: LayoutOptions,    state: WriteState,) !void {    var arena_state = std.heap.ArenaAllocator.init(allocator);    defer arena_state.deinit();    const builder = Builder.init(arena_state.allocator());    try pretty.writeWithState(writer, try valueDoc(builder, value), options, state);}
Called byCallstest sourcelib.pretty.core.src.json.documenttest: writeValueWithState preserves c...jsonwriteValuejsonvalueDocjsonwriteValueWithState
Static calls · unresolved targets: 1 · external targets: 3.

Source: lib/pretty/core/src/json/escape.zig:42

zig
pub fn stringAlloc(allocator: std.mem.Allocator, value: []const u8) ![]const u8 {    return try std.json.Stringify.valueAlloc(allocator, value, .{});}
Called byCallsNo direct callsprivate sourcelib.pretty.core.src.json.documentobjectDocjsonvalueDocjsonstringAlloc
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/escape.zig:3

zig
pub fn writeString(writer: anytype, value: []const u8) !void {    try std.json.Stringify.value(value, .{}, writer);}
Called byCallsNo direct callstest sourcelib.pretty.core.src.json.escapetest: writeString escapes JSON string...jsonwriteFieldNamejsonwriteFieldOptionalStringjsonwriteFieldStringjsonwriteSortedMinifiedjsonwriteString
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/escape.zig:7

zig
pub fn writeStringParts(writer: anytype, parts: []const []const u8) !void {    for (parts) |part| {        if (!std.unicode.utf8ValidateSlice(part)) return error.InvalidUtf8;    }    try writer.writeByte('"');    for (parts) |part| try writeStringContent(writer, part);    try writer.writeByte('"');}
Called byCallstest sourcelib.pretty.core.src.json.escapetest: writeStringParts escapes compos...test sourcelib.pretty.core.src.json.escapetest: writeStringParts rejects invali...private sourcelib.pretty.core.src.json.stream.WriterobjectFieldPartsjson.WriterstringPartsprivate sourcelib.pretty.core.src.json.escapewriteStringContentjsonwriteStringParts
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/pretty/core/src/json/field.zig:25

zig
pub fn writeFieldBool(writer: anytype, name: []const u8, value: bool, field: Field) !void {    try writeFieldName(writer, name, field);    try scalar.writeBool(writer, value);}
Called byCallstest sourcelib.pretty.core.src.json.fieldtest: field helpers write compact obj...jsonwriteFieldNamejsonwriteBooljsonwriteFieldBool
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/field.zig:30

zig
pub fn writeFieldInt(writer: anytype, name: []const u8, value: anytype, field: Field) !void {    try writeFieldName(writer, name, field);    try scalar.writeInt(writer, value);}
Called byCallstest sourcelib.pretty.core.src.json.fieldtest: field helpers write compact obj...jsonwriteFieldNamejsonwriteIntjsonwriteFieldInt
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/field.zig:9

zig
pub fn writeFieldName(writer: anytype, name: []const u8, field: Field) !void {    if (!field.first) try writer.writeByte(',');    try escape.writeString(writer, name);    try writer.writeByte(':');}
Called byCallsjsonwriteFieldBooljsonwriteFieldIntjsonwriteFieldOptionalStringjsonwriteFieldRawjsonwriteFieldStringjsonwriteStringjsonwriteFieldName
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/pretty/core/src/json/field.zig:20

zig
pub fn writeFieldOptionalString(writer: anytype, name: []const u8, value: ?[]const u8, field: Field) !void {    try writeFieldName(writer, name, field);    if (value) |inner| try escape.writeString(writer, inner) else try scalar.writeNull(writer);}
Called byCallstest sourcelib.pretty.core.src.json.fieldtest: field helpers write compact obj...jsonwriteStringjsonwriteFieldNamejsonwriteNulljsonwriteFieldOptionalString
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/field.zig:35

zig
pub fn writeFieldRaw(writer: anytype, name: []const u8, raw_json: []const u8, field: Field) !void {    try writeFieldName(writer, name, field);    try writer.writeAll(raw_json);}
Called byCallsNo direct callersjsonwriteFieldNamejsonwriteFieldRaw
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/pretty/core/src/json/field.zig:15

zig
pub fn writeFieldString(writer: anytype, name: []const u8, value: []const u8, field: Field) !void {    try writeFieldName(writer, name, field);    try escape.writeString(writer, value);}
Called byCallstest sourcelib.pretty.core.src.json.fieldtest: field helpers write compact obj...jsonwriteStringjsonwriteFieldNamejsonwriteFieldString
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/format.zig:48

zig
pub fn renderIndentedAlloc(allocator: std.mem.Allocator, value: anytype) ![]u8 {    var out: std.Io.Writer.Allocating = .init(allocator);    errdefer out.deinit();    try writeIndented(&out.writer, value);    return try out.toOwnedSlice();}
Called byCallstest sourcelib.pretty.core.src.json.formattest: writeIndented serializes two-sp...jsonwriteIndentedjsonrenderIndentedAlloc
Static calls · unresolved targets: 0 · external targets: 2.

Source: lib/pretty/core/src/json/format.zig:24

zig
pub fn renderMinifiedAlloc(    allocator: std.mem.Allocator,    value: anytype,) std.mem.Allocator.Error![]u8 {    var out: std.Io.Writer.Allocating = .init(allocator);    errdefer out.deinit();    writeMinified(&out.writer, value) catch return error.OutOfMemory;    return try out.toOwnedSlice();}
Called byCallstest sourcelib.pretty.core.src.json.formattest: allocated renders expose alloca...test sourcelib.pretty.core.src.json.formattest: writeMinified serializes byte-s...jsonwriteMinifiedjsonrenderMinifiedAlloc
Static calls · unresolved targets: 0 · external targets: 2.

Source: lib/pretty/core/src/json/format.zig:34

zig
pub fn renderMinifiedLineAlloc(    allocator: std.mem.Allocator,    value: anytype,) std.mem.Allocator.Error![]u8 {    var out: std.Io.Writer.Allocating = .init(allocator);    errdefer out.deinit();    writeMinifiedLine(&out.writer, value) catch return error.OutOfMemory;    return try out.toOwnedSlice();}
Called byCallstest sourcelib.pretty.core.src.json.formattest: allocated renders expose alloca...test sourcelib.pretty.core.src.json.formattest: writeMinifiedLine serializes in...jsonwriteMinifiedLinejsonrenderMinifiedLineAlloc
Static calls · unresolved targets: 0 · external targets: 2.

Source: lib/pretty/core/src/json/format.zig:44

zig
pub fn writeIndented(writer: anytype, value: anytype) !void {    try std.json.Stringify.value(value, stringifyOptions(.indent_2), writer);}
Called byCallsjsonrenderIndentedAllocprivate sourcelib.pretty.core.src.json.formatstringifyOptionsjsonwriteIndented
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/format.zig:15

zig
pub fn writeMinified(writer: anytype, value: anytype) !void {    try std.json.Stringify.value(value, stringifyOptions(.minified), writer);}
Called byCallsjsonrenderMinifiedAlloctest sourcelib.pretty.core.src.json.formattest: writeMinified serializes byte-s...jsonwriteMinifiedLineprivate sourcelib.pretty.core.src.json.formatstringifyOptionsjsonwriteMinified
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/pretty/core/src/json/format.zig:19

zig
pub fn writeMinifiedLine(writer: anytype, value: anytype) !void {    try writeMinified(writer, value);    try writer.writeByte('\n');}
Called byCallsjsonrenderMinifiedLineAlloctest sourcelib.pretty.core.src.json.formattest: writeMinifiedLine serializes in...jsonwriteMinifiedjsonwriteMinifiedLine
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/pretty/core/src/json/scalar.zig:5

zig
pub fn writeBool(writer: anytype, value: bool) !void {    try writer.writeAll(if (value) "true" else "false");}
Called byCallsNo direct callsjsonwriteFieldBooljsonwriteSortedMinifiedjsonwriteBool
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/pretty/core/src/json/scalar.zig:9

zig
pub fn writeInt(writer: anytype, value: anytype) !void {    try writer.print("{d}", .{value});}
Called byCallsNo direct callsjsonwriteFieldIntjsonwriteSortedMinifiedjsonwriteInt
Static calls · unresolved targets: 1 · external targets: 0.

Source: lib/pretty/core/src/json/scalar.zig:1

zig
pub fn writeNull(writer: anytype) !void {    try writer.writeAll("null");}
Called byCallsNo direct callsjsonwriteFieldOptionalStringjsonwriteSortedMinifiedjsonwriteNull
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/pretty/core/src/json/scalar.zig:13

zig
pub fn writeNumberString(writer: anytype, value: []const u8) !void {    try writer.writeAll(value);}
Called byCallsNo direct callsjsonwriteSortedMinifiedjsonwriteNumberString
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/pretty/core/src/json/sort.zig:49

zig
pub fn renderSortedMinifiedAlloc(allocator: std.mem.Allocator, value: std.json.Value) ![]u8 {    var out: std.Io.Writer.Allocating = .init(allocator);    errdefer out.deinit();    try writeSortedMinified(&out.writer, allocator, value);    return try out.toOwnedSlice();}
Called byCallstest sourcelib.pretty.core.src.json.sorttest: writeSortedMinified serializes ...jsonwriteSortedMinifiedjsonrenderSortedMinifiedAlloc
Static calls · unresolved targets: 0 · external targets: 2.

Source: lib/pretty/core/src/json/sort.zig:10

zig
pub fn writeSortedMinified(writer: anytype, allocator: std.mem.Allocator, value: std.json.Value) !void {    switch (value) {        .null => try scalar.writeNull(writer),        .bool => |inner| try scalar.writeBool(writer, inner),        .integer => |inner| try scalar.writeInt(writer, inner),        .float => |inner| try writer.print("{d}", .{inner}),        .number_string => |inner| try scalar.writeNumberString(writer, inner),        .string => |inner| try escape.writeString(writer, inner),        .array => |inner| {            try writer.writeByte('[');            for (inner.items, 0..) |item, index| {                if (index != 0) try writer.writeByte(',');                try writeSortedMinified(writer, allocator, item);            }            try writer.writeByte(']');        },        .object => |inner| {            var entries: std.ArrayList(Entry) = .empty;            defer entries.deinit(allocator);            var iterator = inner.iterator();            while (iterator.next()) |entry| {                try entries.append(allocator, .{                    .key = entry.key_ptr.*,                    .value = entry.value_ptr,                });            }            std.sort.insertion(Entry, entries.items, {}, lessEntry);            try writer.writeByte('{');            for (entries.items, 0..) |entry, index| {                if (index != 0) try writer.writeByte(',');                try escape.writeString(writer, entry.key);                try writer.writeByte(':');                try writeSortedMinified(writer, allocator, entry.value.*);            }            try writer.writeByte('}');        },    }}
Called byCallsjsonrenderSortedMinifiedAllocjsonwriteStringjsonwriteBooljsonwriteIntjsonwriteNulljsonwriteNumberStringjsonwriteSortedMinified
Static calls · unresolved targets: 3 · external targets: 3.
Called byCallsNo direct callersjson.Writerarrayjson.Arrayarray
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Writerbase64Stringjson.Arraybase64String
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterbyteStringjson.ArraybyteString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Writerwritejson.Arrayelement
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.ArrayendLinejson.WriterendArrayjson.Arrayend
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Arrayendjson.Writernewlinejson.ArrayendLine
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterformattedStringjson.ArrayformattedString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterhexStringjson.ArrayhexString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Writerobjectjson.Arrayobject
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Writerprintjson.Arrayprint
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Writerrawjson.Arrayraw
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterstringPartsjson.ArraystringParts
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.ObjectformattedArrayjson.Writerarrayjson.WriterobjectFieldjson.Objectarray
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Writerbase64Stringjson.WriterobjectFieldjson.Objectbase64String
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterbyteStringjson.WriterobjectFieldjson.ObjectbyteString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.ObjectendLinejson.WriterendObjectjson.Objectend
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Objectendjson.Writernewlinejson.ObjectendLine
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.Objectfieldsjson.ObjectformattedFieldjson.WriterobjectFieldjson.Writerwritejson.Objectfield
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.pretty.core.src.json.stream.WriterobjectFieldPartsjson.Writerwritejson.ObjectfieldParts
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Objectfieldjson.Objectfields
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Objectarrayjson.ObjectformattedArray
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Objectfieldjson.ObjectformattedField
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.Objectobjectjson.ObjectformattedObject
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterformattedStringjson.WriterobjectFieldjson.ObjectformattedString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterhexStringjson.WriterobjectFieldjson.ObjecthexString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.ObjectformattedObjectjson.Writerobjectjson.WriterobjectFieldjson.Objectobject
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterobjectFieldjson.Writerprintjson.Objectprint
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterobjectFieldjson.Writerrawjson.Objectraw
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersjson.WriterobjectFieldjson.WriterstringPartsjson.ObjectstringParts
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.Arrayarrayjson.Objectarrayjson.WriterbeginArrayjson.Writerarray
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.Arraybase64Stringjson.Objectbase64Stringjson.WriterbeginRawjson.WriterendRawjson.Writerbase64String
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsjson.Writerarraytest sourcelib.pretty.core.src.json.streamtest: Writer streams minified machine...json.WriterbeginArray
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsjson.Writerobjecttest sourcelib.pretty.core.src.json.streamtest: Writer inserts raw values and s...test sourcelib.pretty.core.src.json.streamtest: Writer prints raw formatted JSO...test sourcelib.pretty.core.src.json.streamtest: Writer streams minified machine...json.WriterbeginObject
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsjson.Writerbase64Stringjson.WriterbyteStringjson.WriterhexStringjson.WriterstringPartsjson.WriterbeginRaw
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsjson.ArraybyteStringjson.ObjectbyteStringprivate sourcelib.pretty.core.src.json.escapewriteByteStringjson.WriterbeginRawjson.WriterendRawjson.WriterbyteString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsjson.Arrayendtest sourcelib.pretty.core.src.json.streamtest: Writer streams minified machine...json.WriterendArray
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsjson.Objectendtest sourcelib.pretty.core.src.json.streamtest: Writer inserts raw values and s...test sourcelib.pretty.core.src.json.streamtest: Writer prints raw formatted JSO...test sourcelib.pretty.core.src.json.streamtest: Writer streams minified machine...json.WriterendObject
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsjson.Writerbase64Stringjson.WriterbyteStringjson.WriterhexStringjson.WriterstringPartsjson.WriterendRaw
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsjson.ArrayformattedStringjson.ObjectformattedStringjson.Writerwritejson.WriterformattedString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsjson.ArrayhexStringjson.ObjecthexStringjson.WriterbeginRawjson.WriterendRawjson.WriterhexString
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallstest sourcelib.pretty.core.src.json.streamtest: Object formats and escapes fiel...test sourcelib.pretty.core.src.json.streamtest: Object writes named struct fiel...test sourcelib.pretty.core.src.json.streamtest: Writer composes large nested re...test sourcelib.pretty.core.src.json.streamtest: Writer formats bounded string v...test sourcelib.pretty.core.src.json.streamtest: Writer inserts raw values and s...+8 moreprivate sourcelib.pretty.core.src.json.formatstringifyOptionsjson.Writerinit
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsjson.ArrayendLinejson.ObjectendLinejson.Writernewline
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsjson.Arrayobjectjson.Objectobjecttest sourcelib.pretty.core.src.json.streamtest: Object formats and escapes fiel...test sourcelib.pretty.core.src.json.streamtest: Object writes named struct fiel...test sourcelib.pretty.core.src.json.streamtest: Writer composes large nested re...+7 morejson.WriterbeginObjectjson.Writerobject
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsjson.Objectarrayjson.Objectbase64Stringjson.ObjectbyteStringjson.Objectfieldjson.ObjectformattedString+8 morejson.WriterobjectField
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsjson.Arrayprintjson.Objectprinttest sourcelib.pretty.core.src.json.streamtest: Writer prints raw formatted JSO...json.Writerprint
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callsjson.Arrayrawjson.Objectrawtest sourcelib.pretty.core.src.json.streamtest: Writer inserts raw values and s...json.Writerraw
Static calls · unresolved targets: 0 · external targets: 3.
Called byCallsjson.ArraystringPartsjson.ObjectstringPartstest sourcelib.pretty.core.src.json.streamtest: Writer inserts raw values and s...jsonwriteStringPartsjson.WriterbeginRawjson.WriterendRawjson.WriterstringParts
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsjson.Arrayelementjson.Objectfieldjson.ObjectfieldPartsjson.WriterformattedStringtest sourcelib.pretty.core.src.json.streamtest: Writer streams minified machine...json.Writerwrite
Static calls · unresolved targets: 1 · external targets: 0.

Source: lib/pretty/core/src/json/root.zig

zig
//! Deterministic JSON escaping, tree rendering, and allocation-free streaming.//! Streaming scopes own punctuation and escaping; callers close every scope with `end`.const document = @import("document.zig");const escape = @import("escape.zig");const field = @import("field.zig");const format = @import("format.zig");const scalar = @import("scalar.zig");const sort = @import("sort.zig");const stream = @import("stream.zig");pub const Field = field.Field;pub const Style = format.Style;pub const Writer = stream.Writer;pub const Object = stream.Object;pub const Array = stream.Array;pub const writeString = escape.writeString;pub const writeStringParts = escape.writeStringParts;pub const stringAlloc = escape.stringAlloc;pub const writeMinified = format.writeMinified;pub const writeMinifiedLine = format.writeMinifiedLine;pub const renderMinifiedAlloc = format.renderMinifiedAlloc;pub const renderMinifiedLineAlloc = format.renderMinifiedLineAlloc;pub const writeIndented = format.writeIndented;pub const renderIndentedAlloc = format.renderIndentedAlloc;pub const writeSortedMinified = sort.writeSortedMinified;pub const renderSortedMinifiedAlloc = sort.renderSortedMinifiedAlloc;pub const writeNull = scalar.writeNull;pub const writeBool = scalar.writeBool;pub const writeInt = scalar.writeInt;pub const writeNumberString = scalar.writeNumberString;pub const writeFieldName = field.writeFieldName;pub const writeFieldString = field.writeFieldString;pub const writeFieldOptionalString = field.writeFieldOptionalString;pub const writeFieldBool = field.writeFieldBool;pub const writeFieldInt = field.writeFieldInt;pub const writeFieldRaw = field.writeFieldRaw;pub const valueDoc = document.valueDoc;pub const renderValueAlloc = document.renderValueAlloc;pub const writeValue = document.writeValue;pub const writeValueWithState = document.writeValueWithState;

Source: lib/pretty/core/src/root.zig:105

zig
pub const json = @import("json/root.zig");

Complete caller list for json.Writer.init

13 direct callers.

Complete caller list for json.Writer.object

12 direct callers.

Complete caller list for json.Writer.objectField

13 direct callers.

Audit

Definitions79
Public names79
Members6
Version26.7.0
Revisiondaab053ee433