View the entire allocated capacity of `buf` as a byte slice. Requires that the caller has zeroed any unwritten tail (see `zero_tail`).
(buf: &AlignedBuf)
| 434 | /// View the entire allocated capacity of `buf` as a byte slice. Requires |
| 435 | /// that the caller has zeroed any unwritten tail (see `zero_tail`). |
| 436 | fn full_capacity_slice(buf: &AlignedBuf) -> &[u8] { |
| 437 | // SAFETY: AlignedBuf guarantees `as_ptr` points to `capacity()` valid |
| 438 | // bytes (alloc_zeroed) for the lifetime of the buffer. |
| 439 | unsafe { std::slice::from_raw_parts(buf.as_ptr(), buf.capacity()) } |
| 440 | } |
| 441 | |
| 442 | /// `pwrite`-retry helper that handles short writes. |
| 443 | fn pwrite_all(file: &File, data: &[u8], offset: u64) -> Result<()> { |
no test coverage detected