Attempts to write an entire buffer at the end of a file. This leaves the current position of the file unmodified. This operation is not guaranteed to be atomic with respect to other users of the same open file description. This operation is less efficient on some platforms than opening the file in append mode and doing regular writes.
(&self, mut buf: &[u8])
| 262 | /// This operation is less efficient on some platforms than opening the |
| 263 | /// file in append mode and doing regular writes. |
| 264 | fn append_all(&self, mut buf: &[u8]) -> io::Result<()> { |
| 265 | while !buf.is_empty() { |
| 266 | match self.append(buf) { |
| 267 | Ok(nwritten) => { |
| 268 | buf = &buf[nwritten..]; |
| 269 | } |
| 270 | Err(ref e) if e.kind() == io::ErrorKind::Interrupted => (), |
| 271 | Err(e) => return Err(e), |
| 272 | } |
| 273 | } |
| 274 | Ok(()) |
| 275 | } |
| 276 | |
| 277 | /// Is to `append` what `write_vectored` is to `write`. |
| 278 | fn append_vectored(&self, bufs: &[IoSlice]) -> io::Result<usize> { |
nothing calls this directly
no test coverage detected