Function hyper::ffi::hyper_body_data
source · #[no_mangle]
pub extern "C" fn hyper_body_data(
body: *mut hyper_body
) -> *mut hyper_task
Available on crate feature
ffi
and hyper_unstable_ffi
only.Expand description
Return a task that will poll the body for the next buffer of data.
The task value may have different types depending on the outcome:
HYPER_TASK_BUF
: Success, and more data was received.HYPER_TASK_ERROR
: An error retrieving the data.HYPER_TASK_EMPTY
: The body has finished streaming data.
To avoid a memory leak, the task must eventually be consumed by
hyper_task_free
, or taken ownership of by hyper_executor_push
without subsequently being given back by hyper_executor_poll
.
This does not consume the hyper_body *
, so it may be used to again.
However, it MUST NOT be used or freed until the related task completes.