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

StructDecl

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

Trailing:

  1. captures_len: u32 // if has_captures_len
  2. decls_len: u32, // if has_decls_len
  3. fields_len: u32, // if has_fields_len
  4. backing_int_body_len: u32 // if has_backing_int
  5. capture: Capture // for every captures_len
  6. capture_name: NullTerminatedString // for every captures_len
  7. decl: Index, // for every decls_len; points to a declaration instruction
  8. field_name: NullTerminatedString // for every fields_len
  9. field_type_body_len: u32 // for every fields_len
  10. field_align_body_len: u32 // for every fields_len if any_field_aligns
  11. field_default_body_len: u32 // for every fields_len if any_field_defaults
  12. field_comptime_bits: u32 // one bit per fields_len if any_comptime_fields // LSB is first field, minimum number of u32 needed
  13. backing_int_body_inst: Inst.Index // for each backing_int_body_len
  14. body_inst: Inst.Index // type body, then align body, then default body, for each field

Fields

fields_hash_0: u32

These fields should be concatenated and reinterpreted as a std.zig.SrcHash. This hash contains the source of all fields, and any specified attributes (extern, backing type, etc).

fields_hash_1: u32
fields_hash_2: u32
fields_hash_3: u32
src_line: u32
src_column: u32
src_node: Ast.Node.Index

This node provides a new absolute baseline node for all instructions within this struct.

Structs

File

zig/Zir.zig:3508
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
    pub const StructDecl = struct {
        // These fields should be concatenated and reinterpreted as a `std.zig.SrcHash`.
        // This hash contains the source of all fields, and any specified attributes (`extern`, backing type, etc).
        fields_hash_0: u32,
        fields_hash_1: u32,
        fields_hash_2: u32,
        fields_hash_3: u32,
        src_line: u32,
        src_column: u32,
        /// This node provides a new absolute baseline node for all instructions within this struct.
        src_node: Ast.Node.Index,

        pub const Small = packed struct(u16) {
            has_captures_len: bool,
            has_decls_len: bool,
            has_fields_len: bool,
            name_strategy: NameStrategy,
            layout: std.lang.Type.ContainerLayout,
            /// Always `false` if `layout != .@"packed"`.
            has_backing_int_type: bool,
            any_field_aligns: bool,
            any_field_defaults: bool,
            any_comptime_fields: bool,
            _: u5 = 0,
        };
    }