Function write [src]
Prototype
pub fn write(self: *StreamSource, bytes: []const u8) WriteError!usize
Parameters
self: *StreamSource
bytes: []const u8
Possible Errors
Source
pub fn write(self: *StreamSource, bytes: []const u8) WriteError!usize {
switch (self.*) {
.buffer => |*x| return x.write(bytes),
.const_buffer => return error.AccessDenied,
.file => |x| if (!has_file) unreachable else return x.write(bytes),
}
}