#[no_mangle]
pub extern "C" fn pactffi_message_contents_set_contents_str(
    contents: *mut MessageContents,
    contents_str: *const c_char,
    content_type: *const c_char
)
Expand description

Sets the contents of the message as a string.

  • contents - the message contents to set the contents for
  • contents_str - 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 string 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.