#[no_mangle]
pub extern "C" fn pactffi_sync_message_set_response_contents_str(
message: *mut SynchronousMessage,
index: size_t,
contents: *const c_char,
content_type: *const c_char
)
Expand description
Sets the response contents of the message as a string. 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 response.contents
- pointer to contents to copy from. Must be a valid NULL-terminated UTF-8 string pointer.content_type
- pointer to the NULL-terminated UTF-8 string containing the content type of the data.
§Safety
The message contents and content type must either be NULL pointers, or point to valid UTF-8 encoded NULL-terminated strings. Otherwise behaviour is undefined.
§Error Handling
If the contents is a NULL pointer, it will set the response contents as null. If the content type is a null pointer, or can’t be parsed, it will set the content type as unknown.