Skip to main content

hurray_file_reader_kv_entry

Function hurray_file_reader_kv_entry 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn hurray_file_reader_kv_entry( handle: *const HurrayFileReader, index: u64, out_entry: *mut HurrayKvEntry, ) -> HurrayStatus
Expand description

Copies KV entry index — its key and its typed value — into out_entry.

The pointers inside the entry borrow from the reader: valid until hurray_file_reader_destroy, never to be freed. The entry can be handed straight to hurray_file_writer_finish, which is how a KV section is copied from one file into another without being transcribed.

Returns HURRAY_ERR_INDEX_OUT_OF_BOUNDS if index is past the end.

§Safety

handle MUST point to a live HurrayFileReader, and out_entry MUST be a valid, non-null pointer writable for one HurrayKvEntry.