Skip to main content

moq_origin_announced

Function moq_origin_announced 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn moq_origin_announced( origin: u32, on_announce: Option<extern "C" fn(user_data: *mut c_void, announced: i32)>, user_data: *mut c_void, ) -> i32
Expand description

Learn about all broadcasts published to an origin.

on_announce is invoked with a positive announced ID for each broadcast, then exactly once more with a terminal code: 0 (stopped cleanly) or a negative error. After the terminal (<= 0) callback, on_announce is never called again and user_data is never touched again, so release user_data there. The terminal callback fires even after moq_origin_announced_close.

Returns a non-zero handle on success, or a negative code on failure.

ยงSafety

  • The caller must keep user_data valid until the terminal (<= 0) on_announce callback.