Zig 0.17.0-dev (Split by item)

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 library itself.

OptionalGeneratedFileIndex

Configuration.OptionalGeneratedFileIndex
pub const OptionalGeneratedFileIndex = enum(u32)

File

lib/std/Build/Configuration.zig:1576

Code

pub const OptionalGeneratedFileIndex = enum(u32) {
    none = max_u32,
    _,

    pub fn init(i: ?GeneratedFileIndex) OptionalGeneratedFileIndex {
        return @fromBackingInt(@intCast(@backingInt(i orelse return .none)));
    }

    pub fn unwrap(this: @This()) ?GeneratedFileIndex {
        return switch (this) {
            .none => null,
            else => @fromBackingInt(@intCast(@backingInt(this))),
        };
    }
}