Type Function Alt [src]
Creates a type suitable for instantiating and passing to a "{f}" placeholder.
Prototype
pub fn Alt( comptime Data: type, comptime formatFn: fn (data: Data, writer: *Writer) Writer.Error!void, ) type Parameters
Data: typeformatFn: fn (data: Data, writer: *Writer) Writer.Error!void Source
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);
}
};
}