fn writeStream(out_stream: anytype, options: StringifyOptions) WriteStream(@TypeOf(out_stream), .{ .checked_to_fixed_depth = 256 })

See WriteStream for documentation. Equivalent to calling writeStreamMaxDepth with a depth of 256.

The caller does not need to call deinit() on the returned object.

Parameters

out_stream: anytype,

DocTests

test writeStream {
    var out = ArrayList(u8).init(testing.allocator);
    defer out.deinit();
    var write_stream = writeStream(out.writer(), .{ .whitespace = .indent_2 });
    defer write_stream.deinit();
    try write_stream.beginObject();
    try write_stream.objectField("foo");
    try write_stream.write(123);
    try write_stream.endObject();
    const expected =
        \\{
        \\  "foo": 123
        \\}
    ;
    try testing.expectEqualSlices(u8, expected, out.items);
}