[][src]Type Definition clingo_sys::clingo_solve_event_callback_t

type clingo_solve_event_callback_t = Option<unsafe extern "C" fn(type_: clingo_solve_event_type_t, event: *mut c_void, data: *mut c_void, goon: *mut bool) -> bool>;

Callback function called during search to notify when the search is finished or a model is ready.

If a (non-recoverable) clingo API function fails in this callback, it must return false. In case of errors not related to clingo, set error code ::clingo_error_unknown and return false to stop solving with an error.

The event is either a pointer to a model, a pointer to two statistics objects (per step and accumulated statistics), or a solve result. @attention If the search is finished, the model is NULL.

@param[in] event the current event. @param[in] data user data of the callback @param[out] goon can be set to false to stop solving @return whether the call was successful

@see clingo_control_solve()