hyper_io_set_write

Function hyper_io_set_write 

Source
#[unsafe(no_mangle)]
pub extern "C" fn hyper_io_set_write( io: *mut hyper_io, func: extern "C" fn(*mut c_void, *mut hyper_context<'_>, *const u8, usize) -> usize, )
Available on crate feature ffi and hyper_unstable_ffi only.
Expand description

Set the write function for this IO transport.

Data from the buf pointer should be written to the transport, up to buf_len bytes. The number of bytes written should be the return value.

If there is no data currently available, the callback should create a hyper_waker from its hyper_context argument and register the waker with whatever polling mechanism is used to signal when data is available later on. The return value should be HYPER_IO_PENDING. See the documentation for hyper_waker.

If there is an irrecoverable error reading data, then HYPER_IO_ERROR should be the return value.