pub fn print(buffer: []u8, comptime format: []const u8, args: anytype) PrintError![]u8 buffer: []u8format: []const u8argsNoSpaceLeftAs much as possible was written to the buffer, but it was too small to fit all the printed bytes.
5209
5210
5211
5212
5213
5214
5215pub fn print(buffer: []u8, comptime format: []const u8, args: anytype) PrintError![]u8 {
var w: std.Io.Writer = .fixed(buffer);
w.print(format, args) catch |err| switch (err) {
error.WriteFailed => return error.NoSpaceLeft,
};
return w.buffered();
}
Render a formatted string into
buffer. Returns a slice ofbufferstarting at index 0 containing the result, orerror.NoSpaceLeftif one or more bytes were truncated.See
std.Io.Writer.print.