Function serializeMaxDepth [src]

Like serialize, but recursive types are allowed. Returns error.ExceededMaxDepth if depth is exceeded. Every nested value adds one to a value's depth.

Prototype

pub fn serializeMaxDepth( val: anytype, options: SerializeOptions, writer: anytype, depth: usize, ) (@TypeOf(writer).Error || error{ExceededMaxDepth})!void

Parameters

options: SerializeOptionsdepth: usize

Source

pub fn serializeMaxDepth( val: anytype, options: SerializeOptions, writer: anytype, depth: usize, ) (@TypeOf(writer).Error || error{ExceededMaxDepth})!void { var sz = serializer(writer, .{ .whitespace = options.whitespace, }); try sz.valueMaxDepth(val, .{ .emit_codepoint_literals = options.emit_codepoint_literals, .emit_strings_as_containers = options.emit_strings_as_containers, .emit_default_optional_fields = options.emit_default_optional_fields, }, depth); }