Write bytes to the underlying writer and track position.
(&mut self, data: &[u8])
| 70 | |
| 71 | /// Write bytes to the underlying writer and track position. |
| 72 | async fn write_bytes(&mut self, data: &[u8]) -> io::Result<()> { |
| 73 | self.writer |
| 74 | .write(Bytes::copy_from_slice(data)) |
| 75 | .await |
| 76 | .map_err(|e| io::Error::other(e.to_string()))?; |
| 77 | self.bytes_written += data.len() as u64; |
| 78 | Ok(()) |
| 79 | } |
| 80 | |
| 81 | /// Put a key-value pair. Keys must be monotonically increasing. |
| 82 | pub async fn put(&mut self, key: &[u8], value: &[u8]) -> io::Result<()> { |
no test coverage detected