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.
pubfnreceiveHead(s: *Server) ReceiveHeadError!Request {
consthead_buffer = trys.reader.receiveHead();
return .{
.server = s,
.head_buffer = head_buffer,
// No need to track the returned error here since users can repeat the
// parse with the header buffer to get detailed diagnostics.
.head = Request.Head.parse(head_buffer) catchreturnerror.HttpHeadersInvalid,
};
}