Gather bytes from iovecs starting at the given byte offset into a Vec. # Safety Caller must ensure iovecs point to valid, readable memory of sufficient size.
(iovecs: &[libc::iovec], start: usize, len: usize)
| 286 | /// # Safety |
| 287 | /// Caller must ensure iovecs point to valid, readable memory of sufficient size. |
| 288 | pub unsafe fn gather_from_iovecs(iovecs: &[libc::iovec], start: usize, len: usize) -> Vec<u8> { |
| 289 | let mut result = vec![0u8; len]; |
| 290 | // SAFETY: caller guarantees iovecs are valid; result has len bytes. |
| 291 | unsafe { gather_from_iovecs_into(iovecs, start, &mut result) }; |
| 292 | result |
| 293 | } |
| 294 | |
| 295 | #[cfg(test)] |
| 296 | pub(crate) mod unit_tests { |
no test coverage detected