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.
pubconstSetTimestamp = union(enum) {
/// Leave the existing timestamp unmodified.unchanged,
/// Set to current time using `Io.Clock.real`.now,
/// Set to provided timestamp using `Io.Clock.real`.new: Io.Timestamp,
/// Convenience for interacting with `Stat`, in which `null` indicates `unchanged`.pubfninit(optional: ?Io.Timestamp) SetTimestamp {
returnif (optional) |t| .{ .new = t } else .unchanged;
}
}