Zig 0.17.0-dev (Split by item)
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 library itself.
Zig › std/ › zig/ › llvm/ › Builder.zig › MemoryAccessKind
MemoryAccessKind
Builder.MemoryAccessKind
pub const MemoryAccessKind = enum (u1 )
File
Code
pub const MemoryAccessKind = enum (u1 ) {
normal ,
@"volatile" ,
pub fn format (memory_access_kind : MemoryAccessKind , w : *Writer ) Writer .Error !void {
return Prefixed .format (.{ .memory_access_kind = memory_access_kind , .prefix = "" }, w );
}
pub const Prefixed = struct {
memory_access_kind : MemoryAccessKind ,
prefix : []const u8 ,
pub fn format (p : Prefixed , w : *Writer ) Writer .Error !void {
switch (p .memory_access_kind ) {
.normal => return ,
.@"volatile" => {
var vecs : [2 ][]const u8 = .{ p .prefix , "volatile" };
return w .writeVecAll (&vecs );
},
}
}
};
pub fn fmt (memory_access_kind : MemoryAccessKind , prefix : []const u8 ) Prefixed {
return .{ .memory_access_kind = memory_access_kind , .prefix = prefix };
}
}