Type Definition clingo_sys::clingo_solve_event_callback_t [] [src]

type clingo_solve_event_callback_t = Option<unsafe extern "C" fn(_: clingo_solve_event_type_t, _: *mut c_void, _: *mut c_void, _: *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.

@attention If the search is finished, the model is NULL.

Parameters:

  • model the current model
  • data user data of the callback
  • goon can be set to false to stop solving

Returns whether the call was successful

@see clingo_control_solve()