pub struct RequestOptions { /* private fields */ }Expand description
A set of options configuring a single request.
Application only use this class directly in mocks, where they may want to verify their application has configured all the right request parameters and options.
All other code uses this type indirectly, via the per-request builders.
Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn set_idempotency(&mut self, value: bool)
pub fn set_idempotency(&mut self, value: bool)
Treat the RPC underlying RPC in this method as idempotent.
If a retry policy is configured, the policy may examine the idempotency and the error details to decide if the error is retryable. Typically idempotent RPCs are safe to retry under more error conditions than non-idempotent RPCs.
The client libraries provide a default for RPC idempotency, based on the
HTTP method (GET, POST, DELETE, etc.).
Sourcepub fn set_default_idempotency(self, default: bool) -> Self
pub fn set_default_idempotency(self, default: bool) -> Self
Set the idempotency for the underlying RPC unless it is already set.
If set_idempotency was already called this method has no effect. Otherwise it sets the idempotency. The client libraries use this to provide a default idempotency value.
Sourcepub fn set_user_agent<T: Into<String>>(&mut self, v: T)
pub fn set_user_agent<T: Into<String>>(&mut self, v: T)
Prepends this prefix to the user agent header value.
Sourcepub fn user_agent(&self) -> &Option<String>
pub fn user_agent(&self) -> &Option<String>
Gets the current user-agent prefix
Sourcepub fn set_attempt_timeout<T: Into<Duration>>(&mut self, v: T)
pub fn set_attempt_timeout<T: Into<Duration>>(&mut self, v: T)
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.
Sourcepub fn attempt_timeout(&self) -> &Option<Duration>
pub fn attempt_timeout(&self) -> &Option<Duration>
Gets the current per-attempt timeout.
Sourcepub fn set_retry_policy<V: Into<RetryPolicyArg>>(&mut self, v: V)
pub fn set_retry_policy<V: Into<RetryPolicyArg>>(&mut self, v: V)
Sets the retry policy configuration.
Sourcepub fn set_backoff_policy<V: Into<BackoffPolicyArg>>(&mut self, v: V)
pub fn set_backoff_policy<V: Into<BackoffPolicyArg>>(&mut self, v: V)
Sets the backoff policy configuration.
Sourcepub fn set_retry_throttler<V: Into<RetryThrottlerArg>>(&mut self, v: V)
pub fn set_retry_throttler<V: Into<RetryThrottlerArg>>(&mut self, v: V)
Sets the retry throttling configuration.
Sourcepub fn set_polling_policy<V: Into<PollingPolicyArg>>(&mut self, v: V)
pub fn set_polling_policy<V: Into<PollingPolicyArg>>(&mut self, v: V)
Sets the polling policy configuration.
Sourcepub fn set_polling_backoff_policy<V: Into<PollingBackoffPolicyArg>>(
&mut self,
v: V,
)
pub fn set_polling_backoff_policy<V: Into<PollingBackoffPolicyArg>>( &mut self, v: V, )
Sets the backoff policy configuration.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§fn clone(&self) -> RequestOptions
fn clone(&self) -> RequestOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more