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

Function buffer_bin_and

arrow-buffer/src/buffer/ops.rs:149–170  ·  view source on GitHub ↗

Apply a bitwise and to two inputs and return the result as a Buffer. The inputs are treated as bitmaps, meaning that offsets and length are specified in number of bits. # See Also [`BooleanBuffer::from_bitwise_binary_op`] for creating `BooleanBuffer`s directly

(
    left: &Buffer,
    left_offset_in_bits: usize,
    right: &Buffer,
    right_offset_in_bits: usize,
    len_in_bits: usize,
)

Source from the content-addressed store, hash-verified

147/// # See Also
148/// * [`BooleanBuffer::from_bitwise_binary_op`] for creating `BooleanBuffer`s directly
149pub fn buffer_bin_and(
150 left: &Buffer,
151 left_offset_in_bits: usize,
152 right: &Buffer,
153 right_offset_in_bits: usize,
154 len_in_bits: usize,
155) -> Buffer {
156 let result = BooleanBuffer::from_bitwise_binary_op(
157 left,
158 left_offset_in_bits,
159 right,
160 right_offset_in_bits,
161 len_in_bits,
162 |a, b| a & b,
163 );
164 // Normalize non-zero BooleanBuffer offsets back to a zero-offset Buffer.
165 if result.offset() == 0 {
166 result.into_inner()
167 } else {
168 result.sliced()
169 }
170}
171
172/// Apply a bitwise or to two inputs and return the result as a Buffer.
173/// The inputs are treated as bitmaps, meaning that offsets and length are specified in number of bits.

Callers 3

bench_buffer_andFunction · 0.85
bitandMethod · 0.85

Calls 3

slicedMethod · 0.80
offsetMethod · 0.45
into_innerMethod · 0.45

Tested by

no test coverage detected