pub struct ClientConfiguration { /* private fields */ }Expand description
All the config data that’s parsed from config sources
Implementations§
source§impl ClientConfiguration
impl ClientConfiguration
sourcepub fn builder() -> ClientConfigurationBuilder
pub fn builder() -> ClientConfigurationBuilder
Create a new configuration builder with the given tokens.
sourcepub fn api_url(&self) -> &str
pub fn api_url(&self) -> &str
URL to access the QCS API. Defaults to DEFAULT_API_URL.
sourcepub fn grpc_api_url(&self) -> &str
pub fn grpc_api_url(&self) -> &str
URL to access the gRPC API. Defaults to the value of the QCS_SETTINGS_APPLICATIONS_GRPC_URL environment variable if set, DEFAULT_GRPC_API_URL otherwise.
sourcepub fn quilc_url(&self) -> &str
pub fn quilc_url(&self) -> &str
URL to access quilc. Defaults to the value of the QCS_SETTINGS_APPLICATIONS_QUILC_URL environment variable if set, DEFAULT_QUILC_URL otherwise.
sourcepub fn qvm_url(&self) -> &str
pub fn qvm_url(&self) -> &str
URL to access QVM. Defaults to the value of the QCS_SETTINGS_APPLICATIONS_QVM_URL environment variable if set, DEFAULT_QVM_URL otherwise.
source§impl ClientConfiguration
impl ClientConfiguration
sourcepub async fn load_default(
) -> impl Future<Output = Result<ClientConfiguration, LoadError>>
pub async fn load_default( ) -> impl Future<Output = Result<ClientConfiguration, LoadError>>
Attempt to load config files from ~/.qcs and create a Configuration object
for use with the QCS API using the default profile.
See https://docs.rigetti.com/qcs/references/qcs-client-configuration for details.
Errors
See LoadError.
sourcepub async fn load_profile(
profile_name: String
) -> impl Future<Output = Result<ClientConfiguration, LoadError>>
pub async fn load_profile( profile_name: String ) -> impl Future<Output = Result<ClientConfiguration, LoadError>>
Attempt to load config files from ~/.qcs and create a Configuration object
for use with the QCS API using the specified profile.
See https://docs.rigetti.com/qcs/references/qcs-client-configuration for details.
Errors
See LoadError.
sourcepub async fn get_bearer_access_token(
&self
) -> impl Future<Output = Result<String, RefreshError>>
pub async fn get_bearer_access_token( &self ) -> impl Future<Output = Result<String, RefreshError>>
sourcepub async fn refresh(
&self
) -> impl Future<Output = Result<String, RefreshError>>
pub async fn refresh( &self ) -> impl Future<Output = Result<String, RefreshError>>
Refresh the authentication tokens and return the new access token if successful.
Errors
See RefreshError.
Trait Implementations§
source§impl Clone for ClientConfiguration
impl Clone for ClientConfiguration
source§fn clone(&self) -> ClientConfiguration
fn clone(&self) -> ClientConfiguration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ClientConfiguration
impl Debug for ClientConfiguration
source§impl Default for ClientConfiguration
impl Default for ClientConfiguration
source§fn default() -> ClientConfiguration
fn default() -> ClientConfiguration
source§impl From<ClientConfiguration> for ClientConfigurationBuilder
impl From<ClientConfiguration> for ClientConfigurationBuilder
source§fn from(config: ClientConfiguration) -> ClientConfigurationBuilder
fn from(config: ClientConfiguration) -> ClientConfigurationBuilder
source§impl TokenRefresher for ClientConfiguration
impl TokenRefresher for ClientConfiguration
§type Error = RefreshError
type Error = RefreshError
source§fn refresh_access_token<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, <ClientConfiguration as TokenRefresher>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
ClientConfiguration: 'async_trait,
fn refresh_access_token<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <ClientConfiguration as TokenRefresher>::Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, ClientConfiguration: 'async_trait,
source§fn get_access_token<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<String, <ClientConfiguration as TokenRefresher>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
ClientConfiguration: 'async_trait,
fn get_access_token<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String, <ClientConfiguration as TokenRefresher>::Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, ClientConfiguration: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for ClientConfiguration
impl Send for ClientConfiguration
impl Sync for ClientConfiguration
impl Unpin for ClientConfiguration
impl !UnwindSafe for ClientConfiguration
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request