Function writeSliceSwap [src]
Prototype
pub fn writeSliceSwap(w: *Writer, Elem: type, slice: []const Elem) Error!void
Parameters
w: *Writer
Elem: type
slice: []const Elem
Possible Errors
See the Writer
implementation for detailed diagnostics.
Source
pub fn writeSliceSwap(w: *Writer, Elem: type, slice: []const Elem) Error!void {
for (slice) |elem| {
var tmp = elem;
std.mem.byteSwapAllFields(Elem, &tmp);
try w.writeAll(@ptrCast(&tmp));
}
}