Struct arrow2::ffi::ArrowArrayStreamReader
source · pub struct ArrowArrayStreamReader { /* private fields */ }
Expand description
Implements an iterator of Array
consumed from the C stream interface.
Implementations§
source§impl ArrowArrayStreamReader
impl ArrowArrayStreamReader
sourcepub unsafe fn try_new(iter: Box<ArrowArrayStream>) -> Result<Self, Error>
pub unsafe fn try_new(iter: Box<ArrowArrayStream>) -> Result<Self, Error>
Returns a new ArrowArrayStreamReader
Error
Errors iff the ArrowArrayStream
is out of specification
Safety
This method is intrinsically unsafe
since it assumes that the ArrowArrayStream
contains a valid Arrow C stream interface.
In particular:
- The
ArrowArrayStream
fulfills the invariants of the C stream interface - The schema
get_schema
produces fulfills the C data interface
sourcepub unsafe fn next(&mut self) -> Option<Result<Box<dyn Array>, Error>>
pub unsafe fn next(&mut self) -> Option<Result<Box<dyn Array>, Error>>
Advances this iterator by one array
Error
Errors iff:
- The C stream interface returns an error
- The C stream interface returns an invalid array (that we can identify, see Safety below)
Safety
Calling this iterator’s next
assumes that the ArrowArrayStream
produces arrow arrays
that fulfill the C data interface