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

Guid

Public Struct
std.os.uefi.Guid
pub const Guid = extern struct

GUIDs are align(8) unless otherwise specified.

Fields

time_low: u32
time_mid: u16
time_high_and_version: u16
clock_seq_high_and_reserved: u8
clock_seq_low: u8
node: [6]u8

Functions

pub fn format(self: Guid, writer: *std.Io.Writer) std.Io.Writer.Error!void

Format GUID into hexadecimal lowercase xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format

pub fn eql(a: Guid, b: Guid) bool

File

os/uefi.zig:96
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
pub const Guid = extern struct {
    comptime {
        std.debug.assert(std.mem.Alignment.of(Guid) == .@"8");
    }

    time_low: u32 align(8),
    time_mid: u16,
    time_high_and_version: u16,
    clock_seq_high_and_reserved: u8,
    clock_seq_low: u8,
    node: [6]u8,

    /// Format GUID into hexadecimal lowercase xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format
    pub fn format(self: Guid, writer: *std.Io.Writer) std.Io.Writer.Error!void {
        return writer.print("{x:0>8}-{x:0>4}-{x:0>4}-{x:0>2}{x:0>2}-{x}", .{
            self.time_low,
            self.time_mid,
            self.time_high_and_version,
            self.clock_seq_high_and_reserved,
            self.clock_seq_low,
            self.node,
        });
    }

    pub fn eql(a: Guid, b: Guid) bool {
        return a.time_low == b.time_low and
            a.time_mid == b.time_mid and
            a.time_high_and_version == b.time_high_and_version and
            a.clock_seq_high_and_reserved == b.clock_seq_high_and_reserved and
            a.clock_seq_low == b.clock_seq_low and
            std.mem.eql(u8, &a.node, &b.node);
    }
}