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_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.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§fn clone(&self) -> RequestOptions
fn clone(&self) -> RequestOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestOptions
impl Debug for RequestOptions
Source§impl Default for RequestOptions
impl Default for RequestOptions
Source§fn default() -> RequestOptions
fn default() -> RequestOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RequestOptions
impl !RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl !UnwindSafe for RequestOptions
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