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 standard library.
std › array_hash_map › Custom › dumpIndex Private Function dumpIndex Doc Source Private Function std.array_hash_map.Custom.dumpIndex
fn dumpIndex (header : *IndexHeader , comptime I : type ) void Params File array_hash_map.zig: 1524
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544 fn dumpIndex (header : *IndexHeader , comptime I : type ) void {
const p = std .debug .print ;
p (" index len=0x{x} type={}\n" , .{ header .length (), header .capacityIndexType () });
const indexes = header .indexes (I );
if (indexes .len == 0 ) return ;
var is_empty = false ;
for (indexes , 0 ..) |idx , i | {
if (idx .isEmpty ()) {
is_empty = true ;
} else {
if (is_empty ) {
is_empty = false ;
p (" ...\n" , .{});
}
p (" [0x{x}]: [{}] +{}\n" , .{ i , idx .entry_index , idx .distance_from_start_index });
}
}
if (is_empty ) {
p (" ...\n" , .{});
}
}