#[unsafe(no_mangle)]pub unsafe extern "C" fn pamoja_message_new(
topic: *const c_char,
payload: *const u8,
payload_len: usize,
) -> *mut PamojaMessageExpand description
Builds a message for a host’s recv callback to deliver.
§Arguments
topic- the topic the message arrived on, as null-terminated UTF-8.payload- the payload bytes, or null whenpayload_lenis 0.payload_len- the length ofpayload.
§Returns
A message the receiving side owns once it is stored in out_message; release
it with pamoja_message_free only if it is not handed over. Null if topic
is null or not UTF-8, or payload is null with a nonzero length.
§Safety
topic must be a valid null-terminated string and payload must point to at
least payload_len readable bytes or be null when that length is 0.