2020-11-15 23:54:47 +03:00
|
|
|
module io
|
|
|
|
|
2023-01-25 23:03:20 +03:00
|
|
|
// Writer is the interface that wraps the `write` method, which
|
|
|
|
// writes `buf.len` bytes to the underlying data stream.
|
2020-11-15 23:54:47 +03:00
|
|
|
pub interface Writer {
|
2021-10-11 15:41:31 +03:00
|
|
|
mut:
|
2022-10-16 09:28:57 +03:00
|
|
|
write(buf []u8) !int
|
2020-11-15 23:54:47 +03:00
|
|
|
}
|
|
|
|
|
2023-01-25 23:03:20 +03:00
|
|
|
// RandomWriter is the interface that wraps the `write_to` method,
|
|
|
|
// which writes `buf.len` bytes to the underlying data stream at a random `pos`.
|
2020-11-15 23:54:47 +03:00
|
|
|
pub interface RandomWriter {
|
2022-10-16 09:28:57 +03:00
|
|
|
write_to(pos u64, buf []u8) !int
|
2020-11-15 23:54:47 +03:00
|
|
|
}
|