#[no_mangle]
pub extern "C" fn pactffi_message_contents_set_contents_bin(
contents: *mut MessageContents,
contents_bin: *const c_uchar,
len: size_t,
content_type: *const c_char
)
Expand description
Sets the contents of the message as an array of bytes.
message
- the message contents to set the contents forcontents_bin
- pointer to contents to copy fromlen
- number of bytes to copy from the contents pointercontent_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.