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

Method bitwise_unary_mut

arrow-array/src/array/boolean_array.rs:364–370  ·  view source on GitHub ↗

Try to apply a bitwise operation to this array's values in place using u64 operations. If the underlying buffer is uniquely owned, the operation is applied in place and `Ok` is returned. If the buffer is shared, `Err(self)` is returned so the caller can fall back to [`bitwise_unary`](Self::bitwise_unary). The null buffer is preserved unchanged. # Example ``` # use arrow_array::BooleanArray; le

(self, op: F)

Source from the content-addressed store, hash-verified

362 /// assert_eq!(result, BooleanArray::from(vec![false, true, false]));
363 /// ```
364 pub fn bitwise_unary_mut<F>(self, op: F) -> Result<BooleanArray, BooleanArray>
365 where
366 F: FnMut(u64) -> u64,
367 {
368 self.try_bitwise_unary_in_place(op)
369 .map_err(|(array, _op)| array)
370 }
371
372 /// Apply a bitwise operation to this array's values in place if the buffer
373 /// is uniquely owned, or clone and apply if shared.

Calls 1