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#[cfg(feature = "tracing-config")]
30pub mod tracing_configuration;
31
32#[cfg(feature = "python")]
33pub(crate) mod py;
34
35#[cfg(feature = "python")]
36use pyo3::prelude::*;
37
38#[cfg(feature = "python")]
39rigetti_pyo3::create_init_submodule! {
40    submodules: ["configuration": configuration::init_submodule],
41}
42
43#[cfg(feature = "python")]
44#[pymodule]
45fn qcs_api_client_common(py: Python<'_>, module: &PyModule) -> PyResult<()> {
46    init_submodule("qcs_api_client_common", py, module)
47}