Skip to main content

iter_next

Function iter_next 

Source
pub unsafe fn iter_next<T>(
    handle: *const IterHandle<T>,
) -> Result<Option<T>, FfiError>
Expand description

Pull the next element from a handle: Ok(None) when the iterator is exhausted.

A producer panic from an earlier next doesn’t wedge the handle: the iterator is put back in whatever state the panic left it.

§Errors

Returns a MARSHAL_ERROR_CODE error when handle is null or another _next is advancing it right now.

§Safety

handle must be null or a live pointer from iter_into_raw that isn’t destroyed during the call.