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

Function buffer_bin_or

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

Apply a bitwise or 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

175/// # See Also
176/// * [`BooleanBuffer::from_bitwise_binary_op`] for creating `BooleanBuffer`s directly
177pub fn buffer_bin_or(
178 left: &Buffer,
179 left_offset_in_bits: usize,
180 right: &Buffer,
181 right_offset_in_bits: usize,
182 len_in_bits: usize,
183) -> Buffer {
184 let result = BooleanBuffer::from_bitwise_binary_op(
185 left,
186 left_offset_in_bits,
187 right,
188 right_offset_in_bits,
189 len_in_bits,
190 |a, b| a | b,
191 );
192 // Normalize non-zero BooleanBuffer offsets back to a zero-offset Buffer.
193 if result.offset() == 0 {
194 result.into_inner()
195 } else {
196 result.sliced()
197 }
198}
199
200/// Apply a bitwise xor to two inputs and return the result as a Buffer.
201/// The inputs are treated as bitmaps, meaning that offsets and length are specified in number of bits.

Callers 3

bench_buffer_orFunction · 0.85
bitorMethod · 0.85

Calls 3

slicedMethod · 0.80
offsetMethod · 0.45
into_innerMethod · 0.45

Tested by

no test coverage detected