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 Function

unpack

Public Function
std.Build.Configuration.Step.ConfigHeader.Value.Index.unpack
pub fn unpack(this: @This(), c: *const Configuration) Unpacked

Params

File

Build/Configuration.zig:1141
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
                pub fn unpack(this: @This(), c: *const Configuration) Unpacked {
                    return switch (this) {
                        .int_0 => .{ .u64 = 0 },
                        .int_1 => .{ .u64 = 1 },
                        .bool_false => .{ .bool = false },
                        .bool_true => .{ .bool = true },
                        .undef => .undef,
                        .defined => .defined,
                        _ => {
                            const value = extraData(c, Value, @backingInt(this));
                            return switch (value.flags.tag) {
                                .ident => .{ .ident = value.ident.value.?.slice(c) },
                                .string => .{ .string = value.string.value.?.slice(c) },
                                .small_unsigned => .{ .u64 = value.flags.small },
                                .small_signed => .{ .i64 = @as(i29, @bitCast(value.flags.small)) },
                                .i64 => .{ .i64 = value.i64.value.? },
                                .u64 => .{ .u64 = value.u64.value.? },
                            };
                        },
                    };
                }