Flushes any buffered data and sets the end position of the file.
If not overwriting existing contents, then calling interface.flush
directly is sufficient.
Flush failure is handled by setting err so that it can be handled
along with other write failures.
pub fn end(w: *Writer) EndError!void
pub fn end(w: *Writer) EndError!void {
const io = w.io;
try w.interface.flush();
switch (w.mode) {
.positional,
.positional_simple,
=> w.file.setLength(io, w.pos) catch |err| switch (err) {
error.NonResizable => return,
else => |e| return e,
},
.streaming,
.streaming_simple,
.failure,
=> {},
}
}