Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Constant

safety_checks_hint

Private Constant
std.json.Stringify.safety_checks_hint
const safety_checks_hint: union(enum)

The safety_checks_hint parameter determines how much memory is used to enable assertions that the above grammar is being followed, e.g. tripping an assertion rather than allowing endObject to emit the final } in [[[]]}. "Depth" in this context means the depth of nested [] or {} expressions (or equivalently the amount of recursion on the <value> grammar expression above). For example, emitting the JSON [[[]]] requires a depth of 3. If .checked_to_fixed_depth is used, there is additionally an assertion that the nesting depth never exceeds the given limit. .checked_to_fixed_depth embeds the storage required in the Stringify struct. .assumed_correct requires no space and performs none of these assertions. In fast and small optimization modes, the given safety_checks_hint is ignored and is always treated as .assumed_correct.

File

json/Stringify.zig:70
70
71
72
73
74
const safety_checks_hint: union(enum) {
    /// Rounded up to the nearest multiple of 8.
    checked_to_fixed_depth: usize,
    assumed_correct,
} = .{ .checked_to_fixed_depth = 256 }