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

Function try_for_each_valid_idx

arrow-buffer/src/util/bit_iterator.rs:396–412  ·  view source on GitHub ↗
(
    len: usize,
    offset: usize,
    null_count: usize,
    nulls: Option<&[u8]>,
    f: F,
)

Source from the content-addressed store, hash-verified

394/// [not possible]: https://github.com/rust-lang/rust/issues/69595
395#[inline]
396pub fn try_for_each_valid_idx<E, F: FnMut(usize) -> Result<(), E>>(
397 len: usize,
398 offset: usize,
399 null_count: usize,
400 nulls: Option<&[u8]>,
401 f: F,
402) -> Result<(), E> {
403 let valid_count = len - null_count;
404
405 if valid_count == len {
406 (0..len).try_for_each(f)
407 } else if null_count != len {
408 BitIndexIterator::new(nulls.unwrap(), offset, len).try_for_each(f)
409 } else {
410 Ok(())
411 }
412}
413
414// Note: further tests located in arrow_select::filter module
415

Callers 3

sum_checkedFunction · 0.85
try_unary_mutMethod · 0.85
unary_optMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected