enumstd.zig.Zir.Inst.OptionalIndex[src]

Fields

main_struct_inst = 0

ZIR is structured so that the outermost "main" struct of any file is always at index 0.

ref_start_index = Index.static_len
none = std.math.maxInt(u32)
_

Functions

Functionunwrap[src]

pub fn unwrap(oi: OptionalIndex) ?Index

Parameters

Source Code

Source code
pub fn unwrap(oi: OptionalIndex) ?Index {
    return if (oi == .none) null else @enumFromInt(@intFromEnum(oi));
}

Source Code

Source code
pub const OptionalIndex = enum(u32) {
    /// ZIR is structured so that the outermost "main" struct of any file
    /// is always at index 0.
    main_struct_inst = 0,
    ref_start_index = Index.static_len,
    none = std.math.maxInt(u32),
    _,

    pub fn unwrap(oi: OptionalIndex) ?Index {
        return if (oi == .none) null else @enumFromInt(@intFromEnum(oi));
    }
}