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. Public Struct

SerializeOptions

Public Struct
std.zon.stringify.SerializeOptions
pub const SerializeOptions = struct

Fields

whitespace: bool = true

If false, whitespace is omitted. Otherwise whitespace is emitted in standard Zig style.

emit_codepoint_literals: Serializer.EmitCodepointLiterals = .never

Determines when to emit Unicode code point literals as opposed to integer literals.

emit_strings_as_containers: bool = false

If true, slices of u8s, and pointers to arrays of u8 are serialized as containers. Otherwise they are serialized as string literals.

emit_default_optional_fields: bool = true

If false, struct fields are not written if they are equal to their default value. Comparison is done by std.meta.eql.

escape_non_ascii: bool = false

If true, non-ASCII unicode characters are escaped.

File

zon/stringify.zig:29
29
30
31
32
33
34
35
36
37
38
39
40
41
42
pub const SerializeOptions = struct {
    /// If false, whitespace is omitted. Otherwise whitespace is emitted in standard Zig style.
    whitespace: bool = true,
    /// Determines when to emit Unicode code point literals as opposed to integer literals.
    emit_codepoint_literals: Serializer.EmitCodepointLiterals = .never,
    /// If true, slices of `u8`s, and pointers to arrays of `u8` are serialized as containers.
    /// Otherwise they are serialized as string literals.
    emit_strings_as_containers: bool = false,
    /// If false, struct fields are not written if they are equal to their default value. Comparison
    /// is done by `std.meta.eql`.
    emit_default_optional_fields: bool = true,
    /// If true, non-ASCII unicode characters are escaped.
    escape_non_ascii: bool = false,
}