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 idempotent(&self) -> Option<bool>
pub fn idempotent(&self) -> Option<bool>
Gets the idempotency
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_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 retry_policy(&self) -> &Option<Arc<dyn RetryPolicy>>
pub fn retry_policy(&self) -> &Option<Arc<dyn RetryPolicy>>
Get the current retry policy override, if any.
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 backoff_policy(&self) -> &Option<Arc<dyn BackoffPolicy>>
pub fn backoff_policy(&self) -> &Option<Arc<dyn BackoffPolicy>>
Get the current backoff policy override, if any.
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 retry_throttler(&self) -> &Option<SharedRetryThrottler>
pub fn retry_throttler(&self) -> &Option<SharedRetryThrottler>
Get the current retry throttler override, if any.
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 polling_error_policy(&self) -> &Option<Arc<dyn PollingErrorPolicy>>
pub fn polling_error_policy(&self) -> &Option<Arc<dyn PollingErrorPolicy>>
Get the current polling policy override, if any.
Sourcepub fn set_polling_error_policy<V: Into<PollingErrorPolicyArg>>(&mut self, v: V)
pub fn set_polling_error_policy<V: Into<PollingErrorPolicyArg>>(&mut self, v: V)
Sets the polling policy configuration.
Sourcepub fn polling_backoff_policy(&self) -> &Option<Arc<dyn PollingBackoffPolicy>>
pub fn polling_backoff_policy(&self) -> &Option<Arc<dyn PollingBackoffPolicy>>
Get the current polling backoff policy override, if any.
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