Skip to main content

pamoja_ladder_send

Function pamoja_ladder_send 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_ladder_send( ladder: *mut PamojaLadder, topic: *const c_char, payload: *const u8, payload_len: usize, out_delivery: *mut PamojaDelivery, ) -> PamojaStatus
Expand description

Sends a payload, falling through the rungs and buffering if none take it.

§Arguments

  • ladder - the ladder.
  • topic - the destination topic, as null-terminated UTF-8.
  • payload - the bytes to send.
  • payload_len - the length of payload.
  • out_delivery - receives whether the message went out or was buffered.

§Returns

PamojaStatus::Ok on success, with out_delivery saying which happened. Buffering is a success, not a failure: it is what the ladder exists to do.

§Safety

ladder must be a live handle, topic a valid null-terminated UTF-8 string, payload must point to at least payload_len readable bytes or be null when that length is 0, and out_delivery must be writable or null.