#[unsafe(no_mangle)]pub unsafe extern "C" fn moq_origin_dynamic(
origin: u32,
prefix: *const c_char,
prefix_len: usize,
route: *const moq_route,
on_request: moq_status_callback,
user_data: *mut c_void,
) -> i32Expand description
Advertise prefix and serve the requests beneath it.
A route claims prefix and every path beneath it (the empty prefix claims
every path). A service that only serves some of them advertises the
covering prefix and rejects the rest as they are requested. on_request is
required: a NULL callback is refused before the route is advertised. It is
invoked with a positive request handle for each
pending broadcast, then exactly once more with a terminal code: 0 (stopped
cleanly, including after moq_origin_dynamic_cancel) or a negative error.
After the terminal (<= 0) callback, user_data is never touched again.
Returns a non-zero handle on success, or a negative code on failure.
ยงSafety
- The caller must ensure that prefix is a valid pointer to prefix_len bytes of data.
routemay be NULL, or must point at a readable moq_route.on_requestmust be non-NULL; a missing callback is refused before the route is advertised.- The caller must keep
user_datavalid until the terminal (<= 0)on_requestcallback.