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

SyncScope

Public Enum
std.zig.llvm.Builder.SyncScope
pub const SyncScope = enum(u1)

Structs

Functions

pub fn format(sync_scope: SyncScope, w: *Writer) Writer.Error!void
pub fn fmt(sync_scope: SyncScope, prefix: []const u8) Prefixed

File

zig/llvm/Builder.zig:8252
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
pub const SyncScope = enum(u1) {
    singlethread,
    system,

    pub fn format(sync_scope: SyncScope, w: *Writer) Writer.Error!void {
        return Prefixed.format(.{ .sync_scope = sync_scope, .prefix = "" }, w);
    }

    pub const Prefixed = struct {
        sync_scope: SyncScope,
        prefix: []const u8,

        pub fn format(p: Prefixed, w: *Writer) Writer.Error!void {
            switch (p.sync_scope) {
                .system => return,
                .singlethread => {
                    var vecs: [2][]const u8 = .{ p.prefix, "syncscope(\"singlethread\")" };
                    return w.writeVecAll(&vecs);
                },
            }
        }
    };

    pub fn fmt(sync_scope: SyncScope, prefix: []const u8) Prefixed {
        return .{ .sync_scope = sync_scope, .prefix = prefix };
    }
}