pub struct RequestBuilder<'a, E: CallEndpoint> { /* private fields */ }Expand description
A builder for a single request with per-call overrides.
Created by Client::request. The builder allows
adding extra headers, query parameters, and a per-request timeout before
sending. Retries are not applied on the builder path — use
Client::call for automatic retries.
Implementations§
Source§impl<'a, E: CallEndpoint> RequestBuilder<'a, E>
impl<'a, E: CallEndpoint> RequestBuilder<'a, E>
Sourcepub fn header(
self,
name: impl Into<HeaderName>,
value: impl Into<HeaderValue>,
) -> Self
pub fn header( self, name: impl Into<HeaderName>, value: impl Into<HeaderValue>, ) -> Self
Add a header to this specific request.
Sourcepub fn timeout(self, duration: Duration) -> Self
pub fn timeout(self, duration: Duration) -> Self
Override the timeout for this specific request.
Sourcepub async fn send(self) -> Result<E::Response, ClientError>
pub async fn send(self) -> Result<E::Response, ClientError>
Send the request and deserialize the response body.
Retries are not applied — this executes a single attempt.
Sourcepub async fn send_full(self) -> Result<TypedResponse<E::Response>, ClientError>
pub async fn send_full(self) -> Result<TypedResponse<E::Response>, ClientError>
Send the request and return the full response metadata alongside the body.
Retries are not applied — this executes a single attempt.
Auto Trait Implementations§
impl<'a, E> Freeze for RequestBuilder<'a, E>
impl<'a, E> !RefUnwindSafe for RequestBuilder<'a, E>
impl<'a, E> Send for RequestBuilder<'a, E>
impl<'a, E> Sync for RequestBuilder<'a, E>
impl<'a, E> Unpin for RequestBuilder<'a, E>
impl<'a, E> UnsafeUnpin for RequestBuilder<'a, E>
impl<'a, E> !UnwindSafe for RequestBuilder<'a, E>
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