pub struct RequestOptions { /* private fields */ }Expand description
Per-request overrides applied on top of the client defaults.
Implementations§
Source§impl RequestOptions
impl RequestOptions
Sourcepub fn bearer(self, token: impl Into<String>) -> Self
pub fn bearer(self, token: impl Into<String>) -> Self
Sends Authorization: Bearer <token> for this request only.
Sourcepub fn header(self, name: HeaderName, value: HeaderValue) -> Self
pub fn header(self, name: HeaderName, value: HeaderValue) -> Self
Adds one header for this request only. Replaces a client default header with the same name.
Sourcepub fn retry_mode(self, mode: TransportRetryMode) -> Self
pub fn retry_mode(self, mode: TransportRetryMode) -> Self
Overrides which transport errors make THIS request retry.
By default POST (and other non-idempotent methods) use
TransportRetryMode::PreDispatchOnly so a request already
dispatched to the server cannot be duplicated by a retry; safe
methods (GET/HEAD) follow the client policy. Set
TransportRetryMode::AllTransportErrors here only when the call is
idempotent or deduplicated server side.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§impl Debug for RequestOptions
impl Debug for RequestOptions
Auto Trait Implementations§
impl Freeze for RequestOptions
impl RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin 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