Try to apply a unary op in place. Returns `op` back on failure so callers can fall back to an allocating path without requiring `F: Clone`.
(self, op: F)
| 398 | /// Try to apply a unary op in place. Returns `op` back on failure so |
| 399 | /// callers can fall back to an allocating path without requiring `F: Clone`. |
| 400 | fn try_bitwise_unary_in_place<F>(self, op: F) -> Result<BooleanArray, (BooleanArray, F)> |
| 401 | where |
| 402 | F: FnMut(u64) -> u64, |
| 403 | { |
| 404 | let (values, nulls) = self.into_parts(); |
| 405 | let offset = values.offset(); |
| 406 | let len = values.len(); |
| 407 | let buffer = values.into_inner(); |
| 408 | match buffer.into_mutable() { |
| 409 | Ok(mut buf) => { |
| 410 | bit_util::apply_bitwise_unary_op(buf.as_slice_mut(), offset, len, op); |
| 411 | let values = BooleanBuffer::new(buf.into(), offset, len); |
| 412 | Ok(BooleanArray::new(values, nulls)) |
| 413 | } |
| 414 | Err(buffer) => { |
| 415 | let values = BooleanBuffer::new(buffer, offset, len); |
| 416 | Err((BooleanArray::new(values, nulls), op)) |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | /// Apply a bitwise binary operation to this array and `rhs` using u64 |
| 422 | /// operations, returning a new [`BooleanArray`]. |
no test coverage detected