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

Method from

arrow-array/src/array/boolean_array.rs:652–668  ·  view source on GitHub ↗
(data: Vec<bool>)

Source from the content-addressed store, hash-verified

650
651impl From<Vec<bool>> for BooleanArray {
652 fn from(data: Vec<bool>) -> Self {
653 let mut mut_buf = MutableBuffer::new_null(data.len());
654 {
655 let mut_slice = mut_buf.as_slice_mut();
656 for (i, b) in data.iter().enumerate() {
657 if *b {
658 bit_util::set_bit(mut_slice, i);
659 }
660 }
661 }
662 let array_data = ArrayData::builder(DataType::Boolean)
663 .len(data.len())
664 .add_buffer(mut_buf.into());
665
666 let array_data = unsafe { array_data.build_unchecked() };
667 BooleanArray::from(array_data)
668 }
669}
670
671impl From<Vec<Option<bool>>> for BooleanArray {

Callers

nothing calls this directly

Calls 11

set_bitFunction · 0.85
add_bufferMethod · 0.80
collectMethod · 0.80
lenMethod · 0.45
as_slice_mutMethod · 0.45
iterMethod · 0.45
build_uncheckedMethod · 0.45
into_partsMethod · 0.45
buffersMethod · 0.45
nullsMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected