|
Quantum Resource Management Interface (QRMI) C API
|
Go to the source code of this file.
Classes | |
| struct | QrmiKeyValue |
| struct | QrmiEnvironmentVariables |
| struct | QrmiResourceDef |
| struct | QrmiResourceCapacity |
| struct | QrmiPayload_QiskitPrimitive_Body |
| struct | QrmiPayload_PasqalCloud_Body |
| struct | QrmiPayload_AliceBobFelis_Body |
| struct | QrmiPayload_IQMServer_Body |
| struct | QrmiPayload_Oqtopus_Body |
| struct | QrmiPayload_MaestroLocal_Body |
| struct | QrmiPayload |
| struct | QrmiQuantumResources |
Typedefs | |
| typedef struct QrmiConfig | QrmiConfig |
| typedef struct QrmiQuantumResource | QrmiQuantumResource |
| typedef struct QrmiResourceMetadata | QrmiResourceMetadata |
| typedef struct QrmiResourceProvider | QrmiResourceProvider |
| typedef struct QrmiResourceStatus | QrmiResourceStatus |
| typedef void(* | QrmiLogCallback) (const char *level, const char *target, const char *message) |
| typedef QrmiEnvironmentVariables | QrmiConfigMap |
| typedef struct QrmiConfig QrmiConfig |
QRMI configuration file
Type alias for key-value map
| typedef void(* QrmiLogCallback) (const char *level, const char *target, const char *message) |
C ABI type for qrmi_log_callback_set. This is a C-facing detail: it does not appear anywhere in common.rs, which only knows about plain Rust closures (see common::LogSink). qrmi_log_callback_set below adapts one of these into a LogSink at registration time.
| typedef struct QrmiQuantumResource QrmiQuantumResource |
Quantum resource handle
| typedef struct QrmiResourceMetadata QrmiResourceMetadata |
Quantum resource metadata
| typedef struct QrmiResourceProvider QrmiResourceProvider |
Resource provider handle.
| typedef struct QrmiResourceStatus QrmiResourceStatus |
Quantum resource status
| enum QrmiPayload_Tag |
Resource statuses.
| enum QrmiResourceType |
QRMI resource types
| enum QrmiReturnCode |
Integer return codes returned to C.
| Enumerator | |
|---|---|
| QRMI_RETURN_CODE_SUCCESS | Success. |
| QRMI_RETURN_CODE_ERROR | Error. Generic/uncategorized failure – see qrmi_get_last_error() for the message and qrmi_get_last_error_kind() for a more specific machine-readable reason when available. |
| QRMI_RETURN_CODE_NULL_POINTER_ERROR | Unexpected null pointer. |
| QRMI_RETURN_CODE_ENV_VAR_NOT_SET_ERROR | A required environment variable was not set. |
| QRMI_RETURN_CODE_PARSE_ERROR | A configuration value could not be parsed. |
| QRMI_RETURN_CODE_UNSUPPORTED_RESOURCE_TYPE_ERROR | Dynamic discovery was requested for an unsupported resource type. |
| QRMI_RETURN_CODE_UNSUPPORTED_FUNCTION_ERROR | The requested operation is not supported by this resource. |
| QRMI_RETURN_CODE_UNSUPPORTED_PAYLOAD_ERROR | The payload variant is not supported by this backend. |
| QRMI_RETURN_CODE_TASK_NOT_READY_ERROR | The task is not in a state that allows the requested operation. |
| QRMI_RETURN_CODE_MISSING_CONFIG_KEY_ERROR | A required key was missing from a provider's environment variable map. |
| QRMI_RETURN_CODE_INVALID_INPUT_ERROR | A value was invalid, whether QRMI itself rejected it locally or a vendor's API rejected the resulting request after receiving it. |
| QRMI_RETURN_CODE_RESOURCE_NOT_FOUND_ERROR | The named resource (e.g. a backend) does not exist. |
| QRMI_RETURN_CODE_TASK_NOT_FOUND_ERROR | The named task (e.g. a job) does not exist, or has already been removed. |
| QRMI_RETURN_CODE_AUTHENTICATION_FAILED_ERROR | The request's credentials were missing or rejected. |
| QRMI_RETURN_CODE_INVALID_CONFIG_ERROR | A configuration value (or combination of values) was invalid. |
| enum QrmiTaskStatus |
Task statuses.
| QrmiReturnCode qrmi_get_last_error_kind | ( | void | ) |
Returns a machine-readable classification of the most recent error encountered during an API call, complementing qrmi_get_last_error()'s human-readable message. Unlike qrmi_get_last_error(), this value is NOT cleared after being read, since callers typically check it before (or without) reading the message.
If no QRMI-specific error has been recorded (e.g. the failure came from an unrelated source, or no error has occurred yet), this returns QRMI_RETURN_CODE_ERROR – the generic code – as a safe default.
| QrmiReturnCode qrmi_resource_capacity_free | ( | QrmiResourceCapacity * | ptr | ) |
Frees a QrmiResourceCapacity handle returned by qrmi_resource_status_capacity().
| (ptr) | [in] A QrmiResourceCapacity handle to be freed |
| QrmiReturnCode qrmi_resource_status_busy | ( | QrmiResourceStatus * | status, |
| bool * | outp ) |
Returns whether the resource is currently busy.
| (status) | [in] A QrmiResourceStatus handle |
| (outp) | [out] Whether the resource is busy |
| QrmiReturnCode qrmi_resource_status_capacity | ( | QrmiResourceStatus * | status, |
| QrmiResourceCapacity ** | outp ) |
Returns the resource's capacity information, if reported.
| (status) | [in] A QrmiResourceStatus handle |
| (outp) | [out] Capacity handle if succeeded. Must call qrmi_resource_capacity_free() to free if no longer used. |
| QrmiReturnCode qrmi_resource_status_code | ( | QrmiResourceStatus * | status, |
| QrmiResourceStatusCode * | outp ) |
Returns the resource's status code (Online/Offline/Paused).
| (status) | [in] A QrmiResourceStatus handle |
| (outp) | [out] The status code |
| const char * qrmi_resource_status_code_to_string | ( | QrmiResourceStatusCode | code | ) |
Converts a QrmiResourceStatusCode value to a human-readable, lowercase string ("online", "offline", "paused"). Intended for logging and diagnostic output.
| (code) | [in] A QrmiResourceStatusCode value |
| QrmiReturnCode qrmi_resource_status_free | ( | QrmiResourceStatus * | ptr | ) |
Frees the memory space pointed to by ptr, which must have been returned by a previous call to qrmi_resource_status(). Otherwise, or if ptr has already been freed, segmentation fault occurs. If ptr is NULL, returns < 0.
| (ptr) | [in] A QrmiResourceStatus handle to be free |
| QrmiReturnCode qrmi_resource_status_healthy | ( | QrmiResourceStatus * | status, |
| bool * | outp ) |
Returns whether the resource is currently healthy.
| (status) | [in] A QrmiResourceStatus handle |
| (outp) | [out] Whether the resource is healthy |
| QrmiReturnCode qrmi_resource_status_pending_job_count | ( | QrmiResourceStatus * | status, |
| uint64_t * | outp ) |
Returns the number of jobs pending in the queue.
| (status) | [in] A QrmiResourceStatus handle |
| (outp) | [out] Number of pending jobs |
| char * qrmi_resource_status_reason | ( | QrmiResourceStatus * | status | ) |
Returns the vendor-specific status reason (e.g. "maintenance", "calibration"), if reported.
| (status) | [in] A QrmiResourceStatus handle |