| 633 | /// Caller must ensure that the capacity()-len()>=`size_of<T>`() |
| 634 | #[inline] |
| 635 | pub unsafe fn push_unchecked<T: ToByteSlice>(&mut self, item: T) { |
| 636 | let additional = std::mem::size_of::<T>(); |
| 637 | let src = item.to_byte_slice().as_ptr(); |
| 638 | let dst = unsafe { self.data.as_ptr().add(self.len) }; |
| 639 | unsafe { std::ptr::copy_nonoverlapping(src, dst, additional) }; |
| 640 | self.len += additional; |
| 641 | } |
| 642 | |
| 643 | /// Extends the buffer by `additional` bytes equal to `0u8`, incrementing its capacity if needed. |
| 644 | /// |