pub fn print(self: *Self, gpa: Allocator, comptime fmt: []const u8, args: anytype) error
Prints a formatted string into this list. Invalidates element pointers if additional memory is needed.
self: *Self
gpa: Allocator
fmt: []const u8
args
1166 1167 1168 1169 1170 1171 1172 1173 1174
pub fn print(self: *Self, gpa: Allocator, comptime fmt: []const u8, args: anytype) error{OutOfMemory}!void { comptime assert(T == u8); try self.ensureUnusedCapacity(gpa, fmt.len); var aw: std.Io.Writer.Allocating = .fromArrayList(gpa, self); defer self.* = aw.toArrayList(); return aw.writer.print(fmt, args) catch |err| switch (err) { error.WriteFailed => return error.OutOfMemory, }; }
Prints a formatted string into this list. Invalidates element pointers if additional memory is needed.