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

Method extend_from_slice

arrow-buffer/src/buffer/mutable.rs:592–604  ·  view source on GitHub ↗
(&mut self, items: &[T])

Source from the content-addressed store, hash-verified

590 /// reasons as [`MutableBuffer::reserve`].
591 #[inline]
592 pub fn extend_from_slice<T: ArrowNativeType>(&mut self, items: &[T]) {
593 let additional = mem::size_of_val(items);
594 self.reserve(additional);
595 unsafe {
596 // this assumes that `[ToByteSlice]` can be copied directly
597 // without calling `to_byte_slice` for each element,
598 // which is correct for all ArrowNativeType implementations.
599 let src = items.as_ptr() as *const u8;
600 let dst = self.data.as_ptr().add(self.len);
601 std::ptr::copy_nonoverlapping(src, dst, additional)
602 }
603 self.len += additional;
604 }
605
606 /// Extends the buffer with a new item, increasing its capacity if needed.
607 /// # Example

Callers 15

with_metadataMethod · 0.80
struct_array_valuesFunction · 0.80
mutable_bufferFunction · 0.80
make_prefixFunction · 0.80
make_prefixFunction · 0.80
gen_intervalFunction · 0.80
compressMethod · 0.80
make_prefixFunction · 0.80
make_id_prefixFunction · 0.80

Calls 3

reserveMethod · 0.45
as_ptrMethod · 0.45
addMethod · 0.45