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 › compiler/ › objdump.zig › DumpContext
DumpContext
objdump.DumpContext
const DumpContext = struct
File
Code
const DumpContext = struct {
gpa : std .mem .Allocator ,
opts : *const Options ,
fr : *Io .File .Reader ,
w : *Io .Writer ,
fn element (self : *const DumpContext , e : Element ) bool {
return self .opts .elements .get (e );
}
fn redacted (self : *const DumpContext , opt_kind : ?FieldKind ) bool {
const kind = opt_kind orelse return false ;
return self .opts .redact .get (kind );
}
fn failParse (
ctx : *const DumpContext ,
comptime fmt : []const u8 ,
args : anytype ,
) noreturn {
std .log .err ("error parsing '{s}'" , .{std .fs .path .basename (ctx .opts .input_path )});
fatal (fmt , args );
}
}