Function hyper::ffi::hyper_io_set_write

source ·
#[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, _: size_t) -> size_t
)
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.