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 Enum

Kind

Public Enum
std.zig.Zir.Inst.UnionDecl.Kind
pub const Kind = enum(u3)

Functions

pub fn hasArgType(k: Kind) bool
pub fn layout(k: Kind) std.lang.Type.ContainerLayout

File

zig/Zir.zig:3725
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
        pub const Kind = enum(u3) {
            /// `union`
            auto,
            /// `union(T)`
            tagged_explicit,
            /// `union(enum)`
            tagged_enum,
            /// `union(enum(T))`
            tagged_enum_explicit,
            /// `extern union`
            @"extern",
            /// `packed union`
            @"packed",
            /// `packed union(T)`
            packed_explicit,

            pub fn hasArgType(k: Kind) bool {
                return switch (k) {
                    .auto, .tagged_enum, .@"extern", .@"packed" => false,
                    .tagged_explicit, .tagged_enum_explicit, .packed_explicit => true,
                };
            }

            pub fn layout(k: Kind) std.lang.Type.ContainerLayout {
                return switch (k) {
                    .auto, .tagged_explicit, .tagged_enum, .tagged_enum_explicit => .auto,
                    .@"extern" => .@"extern",
                    .@"packed", .packed_explicit => .@"packed",
                };
            }
        }