Copy the first `len` bytes into an owned Vec. # Safety Caller must ensure `len <= capacity` and the bytes have been written.
(&self, len: usize)
| 68 | /// # Safety |
| 69 | /// Caller must ensure `len <= capacity` and the bytes have been written. |
| 70 | pub unsafe fn to_vec(&self, len: usize) -> Vec<u8> { |
| 71 | unsafe { self.as_slice(len).to_vec() } |
| 72 | } |
| 73 | |
| 74 | /// Total capacity in bytes (always aligned). |
| 75 | #[inline] |