#[no_mangle]
pub extern "C" fn pactffi_sync_message_set_response_contents_bin(
message: *mut SynchronousMessage,
index: size_t,
contents: *const c_uchar,
len: size_t,
content_type: *const c_char
)
Expand description
Sets the response contents of the message at the given index as an array of bytes. If index is greater than the number of responses in the message, the responses will be padded with default values.
message
- the message to set the response contents forindex
- index of the response to set. 0 is the first responsecontents
- pointer to contents to copy fromlen
- number of bytes to copycontent_type
- pointer to the NULL-terminated UTF-8 string containing the content type of the data.
§Safety
The contents pointer must be valid for reads of len
bytes, and it must be properly aligned
and consecutive. Otherwise behaviour is undefined.
§Error Handling
If the contents is a NULL pointer, it will set the message contents as null. If the content type is a null pointer, or can’t be parsed, it will set the content type as unknown.