Function writeSliceSwap [src]

Prototype

pub fn writeSliceSwap(w: *Writer, Elem: type, slice: []const Elem) Error!void

Parameters

w: *WriterElem: typeslice: []const Elem

Possible Errors

WriteFailed

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)); } }