#[unsafe(no_mangle)]pub unsafe extern "C" fn hurray_reader_next_item(
handle: *mut HurrayReader,
out_item: *mut *mut HurrayItem,
) -> HurrayStatusExpand description
Reads the next item: one tensor, or a composite and everything under it.
The assembled view of the same bytes hurray_reader_next_tensor reads flat. A
composite head and its members arrive as one HurrayItem whose nodes a caller walks
in preorder — see crate::item for the shape, and hurray_item_node for the walk.
Returns:
HURRAY_OK—*out_itemis a newHurrayItem, to be released withhurray_item_destroy.HURRAY_END_OF_STREAM— input ended cleanly at an item boundary.*out_itemis untouched.HURRAY_ERR_INVALID_STREAM— the stream ended with a composite head still owed members, or a group failed validation (member count, partition coverage, overlay ordering).HURRAY_ERR_LIMIT_EXCEEDED— nesting exceededmax_composite_depth.- Whatever status the read callback returned, if it failed. The reader’s position is intact, so the same call MAY be retried and resumes mid-tensor.
Both views come from one core, and the assembly happens on this side of it. So mixing
the two calls on one reader is allowed but rarely meant: a
hurray_reader_next_tensor issued while a composite head is open takes the member
that head was waiting for, and the group stays open for the rest of the stream.
§Safety
handleMUST point to a liveHurrayReader.out_itemMUST be a valid, non-null, writable pointer.