Apply a bitwise operation to this array's values using u64 operations, returning a new [`BooleanArray`]. The null buffer is preserved unchanged. See [`BooleanBuffer::from_bitwise_unary_op`] for details on the operation. # Example ``` # use arrow_array::BooleanArray; let array = BooleanArray::from(vec![true, false, true]); let result = array.bitwise_unary(|x| !x); assert_eq!(result, BooleanArra
(&self, op: F)
| 332 | /// assert_eq!(result, BooleanArray::from(vec![false, true, false])); |
| 333 | /// ``` |
| 334 | pub fn bitwise_unary<F>(&self, op: F) -> BooleanArray |
| 335 | where |
| 336 | F: FnMut(u64) -> u64, |
| 337 | { |
| 338 | let values = BooleanBuffer::from_bitwise_unary_op( |
| 339 | self.values.values(), |
| 340 | self.values.offset(), |
| 341 | self.values.len(), |
| 342 | op, |
| 343 | ); |
| 344 | BooleanArray::new(values, self.nulls.clone()) |
| 345 | } |
| 346 | |
| 347 | /// Try to apply a bitwise operation to this array's values in place using |
| 348 | /// u64 operations. |