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

Method unary_mut

arrow-array/src/array/dictionary_array.rs:549–560  ·  view source on GitHub ↗
(self, op: F)

Source from the content-addressed store, hash-verified

547 /// ```
548 #[allow(clippy::result_large_err)]
549 pub fn unary_mut<F, V>(self, op: F) -> Result<DictionaryArray<K>, DictionaryArray<K>>
550 where
551 V: ArrowPrimitiveType,
552 F: Fn(V::Native) -> V::Native,
553 {
554 let mut builder: PrimitiveDictionaryBuilder<K, V> = self.into_primitive_dict_builder()?;
555 builder
556 .values_slice_mut()
557 .iter_mut()
558 .for_each(|v| *v = op(*v));
559 Ok(builder.finish())
560 }
561
562 /// Computes an occupancy mask for this dictionary's values
563 ///

Callers

nothing calls this directly

Calls 3

values_slice_mutMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected