Attempts to write an entire buffer starting from a given offset. This is similar to [`std::os::unix::fs::FileExt::write_all_at`], except it takes `self` by immutable reference since the entire side effect is I/O, and it's supported on non-Unix platforms including Windows. A write past the end of the file extends the file with zero bytes until the point where the write starts. Contrary to POSIX,
(&self, mut buf: &[u8], mut offset: u64)
| 194 | /// |
| 195 | /// [`std::os::unix::fs::FileExt::write_all_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#tymethod.write_all_at |
| 196 | fn write_all_at(&self, mut buf: &[u8], mut offset: u64) -> io::Result<()> { |
| 197 | while !buf.is_empty() { |
| 198 | match self.write_at(buf, offset) { |
| 199 | Ok(nwritten) => { |
| 200 | buf = &buf[nwritten..]; |
| 201 | offset += nwritten as u64; |
| 202 | } |
| 203 | Err(ref e) if e.kind() == io::ErrorKind::Interrupted => (), |
| 204 | Err(e) => return Err(e), |
| 205 | } |
| 206 | } |
| 207 | Ok(()) |
| 208 | } |
| 209 | |
| 210 | /// Is to `write_vectored` what `write_at` is to `write`. |
| 211 | fn write_vectored_at(&self, bufs: &[IoSlice], offset: u64) -> io::Result<usize> { |
nothing calls this directly
no test coverage detected