pub struct CloudClient {
pub retry_config: RetryConfig,
/* private fields */
}Expand description
An authenticated HTTP client for cloud provider APIs.
Created via the provider-specific constructors CloudClient::new_aws,
CloudClient::new_azure, CloudClient::new_google, or
CloudClient::new_databricks, or the simpler CloudClient::new_with_token
and CloudClient::new_unauthenticated.
Fields§
§retry_config: RetryConfigRetry configuration stored for future use by [CloudClient::send].
Currently the retry policy is applied inside credential providers (token
refresh), but is not yet applied to user-initiated requests. Stored here
so that a with_retry_config() builder method can expose it without a
breaking change.
Implementations§
Source§impl CloudClient
impl CloudClient
Sourcepub fn new_aws<I, K, V>(options: I, runtime: Option<&Handle>) -> Result<Self>
pub fn new_aws<I, K, V>(options: I, runtime: Option<&Handle>) -> Result<Self>
Create a new client with AWS credentials.
If runtime is provided, all HTTP I/O (including credential refresh)
will be spawned on the given runtime handle.
Sourcepub fn new_google<I, K, V>(options: I, runtime: Option<&Handle>) -> Result<Self>
pub fn new_google<I, K, V>(options: I, runtime: Option<&Handle>) -> Result<Self>
Create a new client with Google Cloud credentials.
If runtime is provided, all HTTP I/O (including credential refresh)
will be spawned on the given runtime handle.
Sourcepub fn new_azure<I, K, V>(options: I, runtime: Option<&Handle>) -> Result<Self>
pub fn new_azure<I, K, V>(options: I, runtime: Option<&Handle>) -> Result<Self>
Create a new client with Azure credentials.
If runtime is provided, all HTTP I/O (including credential refresh)
will be spawned on the given runtime handle.
Sourcepub fn new_databricks<I, K, V>(
options: I,
runtime: Option<&Handle>,
) -> Result<Self>
pub fn new_databricks<I, K, V>( options: I, runtime: Option<&Handle>, ) -> Result<Self>
Create a new client with Databricks credentials.
If runtime is provided, all HTTP I/O (including credential refresh)
will be spawned on the given runtime handle.
Sourcepub fn new_with_token(token: impl ToString) -> Self
pub fn new_with_token(token: impl ToString) -> Self
Create a new client with a personal access token.
Sourcepub fn new_unauthenticated() -> Self
pub fn new_unauthenticated() -> Self
Create a new unauthenticated client.
Sourcepub fn with_runtime(self, handle: Handle) -> Self
pub fn with_runtime(self, handle: Handle) -> Self
Route all HTTP I/O through the given runtime handle.
This is useful for simple constructors (new_with_token, new_unauthenticated)
where no credential providers need to perform HTTP I/O. For cloud provider
constructors, pass the handle at construction time instead.
Sourcepub fn with_http_service(self, service: Arc<dyn HttpService>) -> Self
pub fn with_http_service(self, service: Arc<dyn HttpService>) -> Self
Replace the HttpService used for request execution.
pub fn request<U: IntoUrl>(&self, method: Method, url: U) -> CloudRequestBuilder
pub fn get<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn post<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn put<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn delete<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn head<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn patch<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn options<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn trace<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
pub fn connect<U: IntoUrl>(&self, url: U) -> CloudRequestBuilder
Trait Implementations§
Source§impl Clone for CloudClient
impl Clone for CloudClient
Source§fn clone(&self) -> CloudClient
fn clone(&self) -> CloudClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more