2020-11-15 23:54:47 +03:00
|
|
|
module io
|
|
|
|
|
2023-01-02 21:20:52 +03:00
|
|
|
// Writer represents a stream of data that can be written to
|
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-02 21:20:52 +03:00
|
|
|
// RandomWriter represents a stream of data that can be written to
|
2020-11-15 23:54:47 +03:00
|
|
|
// at a random pos
|
|
|
|
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
|
|
|
}
|