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

Method from_iter_values

arrow-array/src/array/primitive_array.rs:783–791  ·  view source on GitHub ↗

Creates a PrimitiveArray based on an iterator of values without nulls

(iter: I)

Source from the content-addressed store, hash-verified

781
782 /// Creates a PrimitiveArray based on an iterator of values without nulls
783 pub fn from_iter_values<I: IntoIterator<Item = T::Native>>(iter: I) -> Self {
784 let val_buf: Buffer = iter.into_iter().collect();
785 let len = val_buf.len() / std::mem::size_of::<T::Native>();
786 Self {
787 data_type: T::DATA_TYPE,
788 values: ScalarBuffer::new(val_buf, 0, len),
789 nulls: None,
790 }
791 }
792
793 /// Creates a PrimitiveArray based on an iterator of values with provided nulls
794 pub fn from_iter_values_with_nulls<I: IntoIterator<Item = T::Native>>(

Callers

nothing calls this directly

Calls 3

collectMethod · 0.80
into_iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected