Function printVector [src]
Prototype
pub fn printVector( w: *Writer, comptime fmt: []const u8, options: std.fmt.Options, value: anytype, max_depth: usize, ) Error!void
Parameters
w: *Writer
fmt: []const u8
options: std.fmt.Options
max_depth: usize
Possible Errors
See the Writer
implementation for detailed diagnostics.
Source
pub fn printVector(
w: *Writer,
comptime fmt: []const u8,
options: std.fmt.Options,
value: anytype,
max_depth: usize,
) Error!void {
const len = @typeInfo(@TypeOf(value)).vector.len;
if (max_depth == 0) return w.writeAll("{ ... }");
try w.writeAll("{ ");
inline for (0..len) |i| {
try w.printValue(fmt, options, value[i], max_depth - 1);
if (i < len - 1) try w.writeAll(", ");
}
try w.writeAll(" }");
}