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() -> Result<Self, LoadError>
pub async fn load_default() -> Result<Self, 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) -> Result<Self, LoadError>
pub async fn load_profile(profile_name: String) -> Result<Self, 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) -> Result<String, RefreshError>
pub async fn get_bearer_access_token(&self) -> Result<String, RefreshError>
sourcepub async fn refresh(&self) -> Result<String, RefreshError>
pub async fn refresh(&self) -> 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§impl From<ClientConfiguration> for ClientConfigurationBuilder
impl From<ClientConfiguration> for ClientConfigurationBuilder
source§fn from(config: ClientConfiguration) -> Self
fn from(config: ClientConfiguration) -> Self
source§impl TokenRefresher for ClientConfiguration
impl TokenRefresher for ClientConfiguration
§type Error = RefreshError
type Error = RefreshError
Auto Trait Implementations§
impl Freeze for ClientConfiguration
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more