#[unsafe(no_mangle)]pub unsafe extern "C" fn hurray_file_reader_new(
transport: *const HurrayTransport,
out_handle: *mut *mut HurrayFileReader,
) -> HurrayStatusExpand description
Opens a Hurray file over transport: header, trailer, footer index and KV section.
The transport’s read_at and size callbacks are both required — the container is
located from its end, so its size is a precondition of opening it. The vtable is
copied, so the caller MAY free the HurrayTransport struct immediately; its ctx
must stay valid until the reader is destroyed, at which point the vtable’s release
callback is invoked.
Returns:
HURRAY_OK—*out_handleis a new reader.HURRAY_ERR_INVALID_MAGIC— not aHRRYFILE.HURRAY_ERR_VERSION_MISMATCH— a container version this build does not read.HURRAY_ERR_INVALID_FILE— the footer does not check out: a CRC mismatch, an index overrunning the trailer, unknown header flags.HURRAY_ERR_UNEXPECTED_EOF— the file is shorter than its own structure claims.- Whatever status a callback returned, if it failed. A failed open is terminal: there is no index to start from, so create a new reader rather than retrying this one.
§Safety
transportMUST point to a readableHurrayTransportfor the duration of the call.out_handleMUST be a valid, non-null, writable pointer.