#[unsafe(no_mangle)]pub unsafe extern "C" fn laminar_subscribe_callback(
conn: *mut LaminarConnection,
query: *const c_char,
on_data: LaminarSubscriptionCallback,
on_error: LaminarErrorCallback,
user_data: *mut c_void,
out: *mut *mut LaminarSubscriptionHandle,
) -> i32Expand description
Create a callback-based subscription.
The on_data callback is invoked from a background thread when new data
arrives. The callback receives ownership of the batch and must free it.
§Arguments
conn- Database connectionquery- SQL query string (null-terminated)on_data- Callback for data batches (may be NULL to ignore data)on_error- Callback for errors (may be NULL to ignore errors)user_data- Opaque pointer passed to callbacksout- Pointer to receive subscription handle
§Returns
LAMINAR_OK on success, or an error code.
§Safety
connmust be a valid connection handlequerymust be a valid null-terminated UTF-8 stringoutmust be a valid pointer- Callbacks must be thread-safe if
user_datais shared