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 Type Function

EnumOptional

Public Type Function
std.Build.Configuration.Storage.EnumOptional
pub fn EnumOptional(
        comptime flags_arg: @EnumLiteral(),
        comptime flag_arg: @EnumLiteral(),
        comptime tag_arg: @EnumLiteral(),
        comptime ValueArg: type,
    ) type

The field is present if an enum tag from flags matches a specific value.

Fields

value: ?Value

Values

File

Build/Configuration.zig:2578
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
    pub fn EnumOptional(
        comptime flags_arg: @EnumLiteral(),
        comptime flag_arg: @EnumLiteral(),
        comptime tag_arg: @EnumLiteral(),
        comptime ValueArg: type,
    ) type {
        return struct {
            value: ?Value,

            pub const storage: Storage = .enum_optional;
            pub const flags = flags_arg;
            pub const flag = flag_arg;
            pub const tag = tag_arg;
            pub const Value = ValueArg;
        };
    }