[−][src]Function dqcsim::bindings::dqcs_pdef_set_free_cb
#[no_mangle]pub extern "C" fn dqcs_pdef_set_free_cb(
pdef: dqcs_handle_t,
callback: Option<extern "C" fn(user_data: *mut c_void, state: dqcs_plugin_state_t, qubits: dqcs_handle_t) -> dqcs_return_t>,
user_free: Option<extern "C" fn(user_data: *mut c_void)>,
user_data: *mut c_void
) -> dqcs_return_t
Sets the qubit deallocation callback for operators and backends.
The default for operators is to pass through to dqcs_plugin_free()
.
The default for backends is no-op. This callback is never called for
frontend plugins.
Besides the common arguments, the callback receives a handle to a qubit set containing the qubits that are to be freed. This is a borrowed handle; the caller will delete it.
The callback can return an error by setting an error message using
dqcs_error_set()
and returning DQCS_FAILURE
. Otherwise, it should
return DQCS_SUCCESS
.