Creates a type suitable for instantiating and passing to a "{f}" placeholder.
pub fn Alt(
comptime Data: type,
comptime formatFn: fn (data: Data, writer: *Writer) Writer.Error!void,
) type
pub fn Alt(
comptime Data: type,
comptime formatFn: fn (data: Data, writer: *Writer) Writer.Error!void,
) type {
return struct {
data: Data,
pub inline fn format(self: @This(), writer: *Writer) Writer.Error!void {
try formatFn(self.data, writer);
}
};
}