MCPcopy Create free account
hub / github.com/apache/arrow-rs / push

Method push

arrow-buffer/src/buffer/mutable.rs:620–629  ·  view source on GitHub ↗
(&mut self, item: T)

Source from the content-addressed store, hash-verified

618 /// reasons as [`MutableBuffer::reserve`].
619 #[inline]
620 pub fn push<T: ToByteSlice>(&mut self, item: T) {
621 let additional = std::mem::size_of::<T>();
622 self.reserve(additional);
623 unsafe {
624 let src = item.to_byte_slice().as_ptr();
625 let dst = self.data.as_ptr().add(self.len);
626 std::ptr::copy_nonoverlapping(src, dst, additional);
627 }
628 self.len += additional;
629 }
630
631 /// Extends the buffer with a new item, without checking for sufficient capacity
632 /// # Safety

Callers 15

collect_boolMethod · 0.45
extend_from_iterMethod · 0.45
from_lengthsMethod · 0.45
appendMethod · 0.45
newMethod · 0.45
push_lengthMethod · 0.45

Calls 4

to_byte_sliceMethod · 0.80
reserveMethod · 0.45
as_ptrMethod · 0.45
addMethod · 0.45