1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/io/writer.v

15 lines
398 B
V
Raw Normal View History

module io
// Writer is the interface that wraps the `write` method, which
// writes `buf.len` bytes to the underlying data stream.
pub interface Writer {
mut:
write(buf []u8) !int
}
// RandomWriter is the interface that wraps the `write_to` method,
// which writes `buf.len` bytes to the underlying data stream at a random `pos`.
pub interface RandomWriter {
write_to(pos u64, buf []u8) !int
}