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 Struct

Func

Public Struct
std.zig.Zir.Inst.Func
pub const Func = struct

Trailing: if (ret_ty.body_len == 1) {

  1. return_type: Ref } if (ret_ty.body_len > 1) {
  2. return_type: Index // for each ret_ty.body_len }
  3. body: Index // for each body_len
  4. src_locs: SrcLocs // if body_len != 0
  5. proto_hash: std.zig.SrcHash // if body_len != 0; hash of function prototype

Fields

ret_ty: RetTy
param_block: Index

Points to the block that contains the param instructions for this function. If this is a declaration, it refers to the declaration's value body.

body_len: u32

Structs

File

zig/Zir.zig:2614
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
    pub const Func = struct {
        ret_ty: RetTy,
        /// Points to the block that contains the param instructions for this function.
        /// If this is a `declaration`, it refers to the declaration's value body.
        param_block: Index,
        body_len: u32,

        pub const RetTy = packed struct(u32) {
            /// 0 means `void`.
            /// 1 means the type is a simple `Ref`.
            /// Otherwise, the length of a trailing body.
            body_len: u31,
            /// Whether the return type is generic, i.e. refers to one or more previous parameters.
            is_generic: bool,
        };

        pub const SrcLocs = struct {
            /// Line index in the source file relative to the parent decl.
            lbrace_line: u32,
            /// Line index in the source file relative to the parent decl.
            rbrace_line: u32,
            /// lbrace_column is least significant bits u16
            /// rbrace_column is most significant bits u16
            columns: u32,
        };
    }