Struct google_cloud_storage::client::ClientConfig
source · pub struct ClientConfig {
pub http: Option<ClientWithMiddleware>,
pub storage_endpoint: String,
pub service_account_endpoint: String,
pub token_source_provider: Option<Box<dyn TokenSourceProvider>>,
pub default_google_access_id: Option<String>,
pub default_sign_by: Option<SignBy>,
pub project_id: Option<String>,
}Expand description
§Example building a client configuration with a custom retry strategy as middleware:
async fn configuration_with_exponential_backoff_retry_strategy() -> ClientConfig {
let retry_policy = ExponentialBackoff::builder()
.base(2)
.jitter(Jitter::Full)
.build_with_max_retries(3);
let mid_client = ClientBuilder::new(reqwest::Client::default())
// reqwest-retry already comes with a default retry stategy that matches http standards
// override it only if you need a custom one due to non standard behaviour
.with(RetryTransientMiddleware::new_with_policy(retry_policy))
.build();
ClientConfig {
http: Some(mid_client),
..Default::default()
}
}
Fields§
§http: Option<ClientWithMiddleware>§storage_endpoint: String§service_account_endpoint: String§token_source_provider: Option<Box<dyn TokenSourceProvider>>§default_google_access_id: Option<String>§default_sign_by: Option<SignBy>§project_id: Option<String>Implementations§
source§impl ClientConfig
impl ClientConfig
source§impl ClientConfig
impl ClientConfig
pub async fn with_auth(self) -> Result<Self, Error>
pub async fn with_credentials( self, credentials: CredentialsFile ) -> Result<Self, Error>
Trait Implementations§
source§impl Debug for ClientConfig
impl Debug for ClientConfig
Auto Trait Implementations§
impl !RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl !UnwindSafe for ClientConfig
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
Mutably borrows from an owned value. Read more