Crate qcs_api_client_grpc
source ·Expand description
This crate provides an autogenerated gRPC client for the QCS API, along with helper utilities for automatically loading credentials from a user’s QCS config and keeping authentication tokens refreshed.
get_channel
: create aChannel
to the given gRPC endpoint with QCS authentication automatically set up.wrap_channel
: wrap an existingChannel
with QCS authentication.
Quick Start
use qcs_api_client_grpc::get_channel;
use qcs_api_client_grpc::services::controller::controller_client::ControllerClient;
use qcs_api_client_grpc::services::translation::translation_client::TranslationClient;
async fn controller_request() {
let uri = "example.per-qpu.rigetti.com:50000".parse().unwrap();
let channel = get_channel(uri);
let mut client = ControllerClient::new(channel);
// Use the client
}
fn translation_request() {
let uri = "example.translation.rigetti.com:50000".parse().unwrap();
let channel = get_channel(uri);
let mut client = TranslationClient::new(channel);
// Use the client
}
Crate features
server
: include the generated server code for both Controller Service and Translation Serviceregen
: regenerate the protobuf code and store it in./src/gen
By default, both features are disabled.
Re-exports
Modules
This module contains helper code for wrapping a
Channel
so that QCS credentials are
automatically used and refreshed as necessary.This module is used for loading configuration that will be used to connect either to real QPUs
(and supporting services) or the QVM.