Skip to main content

hurray_file_writer_new

Function hurray_file_writer_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn hurray_file_writer_new( transport: *const HurrayTransport, options: *const HurrayFileWriterOptions, out_handle: *mut *mut HurrayFileWriter, ) -> HurrayStatus
Expand description

Creates a file writer over transport and writes the 64-byte file header.

The header goes out here, not on the first tensor, which is what makes every later offset in the file knowable without seeking back.

§Arguments

  • transport — Non-null; its write callback MUST be non-null. read_at and size are not used: a file writer never reads what it has written.
  • options — MAY be null for HurrayFileWriterOptions’ documented defaults.
  • out_handle — Non-null pointer to a *mut HurrayFileWriter; set on success.

Returns HURRAY_ERR_INVALID_FILE if data_buffer_alignment is not a power of two in range.

§Safety

  • transport MUST point to a readable HurrayTransport for the duration of the call.
  • options, if non-null, MUST point to a readable HurrayFileWriterOptions.
  • out_handle MUST be a valid, non-null, writable pointer.