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.

typeDecls

Zir.typeDecls
pub fn typeDecls(zir: Zir, type_decl: Inst.Index) []const Zir.Inst.Index

File

lib/std/zig/Zir.zig:5248

Code

pub fn typeDecls(zir: Zir, type_decl: Inst.Index) []const Zir.Inst.Index {
    const inst = zir.instructions.get(@backingInt(type_decl));
    assert(inst.tag == .extended);
    return switch (inst.data.extended.opcode) {
        .struct_decl => zir.getStructDecl(type_decl).decls,
        .union_decl => zir.getUnionDecl(type_decl).decls,
        .enum_decl => zir.getEnumDecl(type_decl).decls,
        .opaque_decl => zir.getOpaqueDecl(type_decl).decls,
        else => unreachable,
    };
}