• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16339747936

17 Jul 2025 08:09AM UTC coverage: 80.702% (-0.002%) from 80.704%
16339747936

push

github

web-flow
Use ptr::default in Rust 1.88 (#3896)

Signed-off-by: Nicholas Gates <nick@nickgates.com>

0 of 14 new or added lines in 5 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

41864 of 51875 relevant lines covered (80.7%)

157546.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/vortex-ffi/src/array_iterator.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use std::ptr;
5

6
use vortex::iter::ArrayIterator;
7

8
use crate::array::vx_array;
9
use crate::box_dyn_wrapper;
10
use crate::error::{try_or_default, vx_error};
11

12
box_dyn_wrapper!(
13
    /// A Vortex array iterator.
14
    ///
15
    /// Once the iterator is finished (returns `null` from [`vx_array_iterator_next`]), it may panic
16
    /// on subsequent calls to [`vx_array_iterator_next`].
17
    ///
18
    /// Even after the iterator is finished, an owned iterator must be released by calling
19
    /// [`vx_array_iter_free`].
20
    ///
21
    /// Iterators may be passed between threads, but calls to [`vx_array_iterator_next`] should be
22
    /// serialized and not invoked concurrently.
23
    dyn ArrayIterator,
24
    vx_array_iterator
25
);
26

27
/// Attempt to advance the `current` pointer of the iterator.
28
///
29
/// A return value of `true` indicates that another element was pulled from the iterator, and a return
30
/// of `false` indicates that the iterator is finished.
31
///
32
/// It is an error to call this function again after the iterator is finished.
33
#[unsafe(no_mangle)]
34
pub unsafe extern "C-unwind" fn vx_array_iterator_next(
×
35
    iter: *mut vx_array_iterator,
×
36
    error_out: *mut *mut vx_error,
×
37
) -> *const vx_array {
×
38
    let iter = vx_array_iterator::as_mut(iter);
×
NEW
39
    try_or_default(error_out, || {
×
40
        let element = iter.next();
×
41

42
        if let Some(element) = element {
×
43
            Ok(vx_array::new(element?))
×
44
        } else {
45
            // Drop the iter pointer.
46
            Ok(ptr::null_mut())
×
47
        }
48
    })
×
49
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc