pub trait RequestOptionsBuilder {
// Required methods
fn with_idempotency(self, v: bool) -> Self;
fn with_user_agent<V: Into<String>>(self, v: V) -> Self;
fn with_attempt_timeout<V: Into<Duration>>(self, v: V) -> Self;
fn with_retry_policy<V: Into<RetryPolicyArg>>(self, v: V) -> Self;
fn with_backoff_policy<V: Into<BackoffPolicyArg>>(self, v: V) -> Self;
fn with_retry_throttler<V: Into<RetryThrottlerArg>>(self, v: V) -> Self;
fn with_polling_policy<V: Into<PollingPolicyArg>>(self, v: V) -> Self;
fn with_polling_backoff_policy<V: Into<PollingBackoffPolicyArg>>(
self,
v: V,
) -> Self;
}Expand description
Implementations of this trait provide setters to configure request options.
The Google Cloud Client Libraries for Rust provide a builder for each RPC. These builders can be used to set the request parameters, e.g., the name of the resource targeted by the RPC, as well as any options affecting the request, such as additional headers or timeouts.
Required Methods§
Sourcefn with_idempotency(self, v: bool) -> Self
fn with_idempotency(self, v: bool) -> Self
If v is true, treat the RPC underlying this method as idempotent.
Sourcefn with_user_agent<V: Into<String>>(self, v: V) -> Self
fn with_user_agent<V: Into<String>>(self, v: V) -> Self
Set the user agent header.
Sourcefn with_attempt_timeout<V: Into<Duration>>(self, v: V) -> Self
fn with_attempt_timeout<V: Into<Duration>>(self, v: V) -> Self
Sets the per-attempt timeout.
When using a retry loop, this affects the timeout for each attempt. The overall timeout for a request is set by the retry policy.
Sourcefn with_retry_policy<V: Into<RetryPolicyArg>>(self, v: V) -> Self
fn with_retry_policy<V: Into<RetryPolicyArg>>(self, v: V) -> Self
Sets the retry policy configuration.
Sourcefn with_backoff_policy<V: Into<BackoffPolicyArg>>(self, v: V) -> Self
fn with_backoff_policy<V: Into<BackoffPolicyArg>>(self, v: V) -> Self
Sets the backoff policy configuration.
Sourcefn with_retry_throttler<V: Into<RetryThrottlerArg>>(self, v: V) -> Self
fn with_retry_throttler<V: Into<RetryThrottlerArg>>(self, v: V) -> Self
Sets the retry throttler configuration.
Sourcefn with_polling_policy<V: Into<PollingPolicyArg>>(self, v: V) -> Self
fn with_polling_policy<V: Into<PollingPolicyArg>>(self, v: V) -> Self
Sets the polling policy configuration.
Sourcefn with_polling_backoff_policy<V: Into<PollingBackoffPolicyArg>>(
self,
v: V,
) -> Self
fn with_polling_backoff_policy<V: Into<PollingBackoffPolicyArg>>( self, v: V, ) -> Self
Sets the polling backoff policy configuration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<T> RequestOptionsBuilder for Twhere
T: RequestBuilder,
Implements the RequestOptionsBuilder trait for any RequestBuilder implementation.