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 Enum

Attributes

Public Enum
std.zig.llvm.Builder.Attributes
pub const Attributes = enum(u32)

Structs

Functions

pub fn slice(self: Attributes, builder: *const Builder) []const Attribute.Index
fn format(data: FormatData, w: *Writer) Writer.Error!void
pub fn fmt(self: Attributes, builder: *const Builder, flags: FormatData.Flags) std.fmt.Alt(FormatData, format)

File

zig/llvm/Builder.zig:2527
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
pub const Attributes = enum(u32) {
    none,
    _,

    pub fn slice(self: Attributes, builder: *const Builder) []const Attribute.Index {
        const start = builder.attributes_indices.items[@backingInt(self)];
        const end = builder.attributes_indices.items[@backingInt(self) + 1];
        return @ptrCast(builder.attributes_extra.items[start..end]);
    }

    const FormatData = struct {
        attributes: Attributes,
        builder: *const Builder,
        flags: Flags = .{},
        const Flags = Attribute.Index.FormatData.Flags;
    };
    fn format(data: FormatData, w: *Writer) Writer.Error!void {
        for (data.attributes.slice(data.builder)) |attribute_index| try Attribute.Index.format(.{
            .attribute_index = attribute_index,
            .builder = data.builder,
            .flags = data.flags,
        }, w);
    }
    pub fn fmt(self: Attributes, builder: *const Builder, flags: FormatData.Flags) std.fmt.Alt(FormatData, format) {
        return .{ .data = .{ .attributes = self, .builder = builder, .flags = flags } };
    }
}