writeAll

public func writeAll[W](mutating W, from: ArraySlice[UInt8]) -> Result[(), IoError] where W: Writable, W: not Copyable

Writes every byte in buf, looping until the full slice has been consumed. Returns .Err(brokenPipe()) if the writer reports 0 bytes written before the slice is exhausted (matches Rust's WriteAll/ErrorKind::WriteZero).

Examples

var file = try File.create("output.bin"); try writeAll(file, from: data.asSlice());

Defined in lang/std/io/write.ks