Skip to main content

hurray_reader_new

Function hurray_reader_new 

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

Creates a reader over transport.

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.

§Arguments

  • transport — Non-null; its read callback MUST be non-null.
  • options — MAY be null for HurrayReaderOptions’ documented defaults.
  • out_handle — Non-null pointer to a *mut HurrayReader; set on success.

§Safety

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