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.
fnaddress4FromPosix(in: *constposix.sockaddr.in) net.Ip4Address {
// The network byte order address in `in.addr` is already the byte order we want.constaddr_bytes: *const [4]u8 = @ptrCast(&in.addr);
return .{
.port = std.mem.bigToNative(u16, in.port),
.bytes = addr_bytes.*,
};
}