qcs_api_client_common/
lib.rs

1// Copyright 2022 Rigetti Computing
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Implementation code common to the QCS OpenAPI and gRPC clients.
16//!
17//! You probably don't need to use this directly, as the clients should expose anything you might
18//! need.
19//!
20//! # Features
21//!
22//! - `tracing`: enables `tracing` support in [`ClientConfiguration`].
23//! - `tracing-config`: enables [`TracingConfiguration`] support for enabling/disabling traces per-URL.
24//!   Requires the `tracing` feature.
25//! - `python`: enables Python bindings for the client.
26pub mod backoff;
27pub mod configuration;
28pub use configuration::ClientConfiguration;
29
30#[cfg(feature = "clap")]
31pub mod clap_utils;
32
33#[cfg(feature = "tracing-config")]
34pub mod tracing_configuration;
35
36#[cfg(feature = "python")]
37pub(crate) mod py;
38
39#[cfg(feature = "python")]
40use pyo3::prelude::*;
41
42#[cfg(feature = "python")]
43rigetti_pyo3::create_init_submodule! {
44    submodules: ["configuration": configuration::init_submodule],
45}
46
47#[cfg(feature = "python")]
48#[pymodule]
49fn qcs_api_client_common(py: Python<'_>, module: &PyModule) -> PyResult<()> {
50    init_submodule("qcs_api_client_common", py, module)
51}