pub struct EndpointRequestBuilder<'a, E: Endpoint> { /* private fields */ }Expand description
Fluent builder for a typed Endpoint.
Implementations§
Source§impl<'a, E: Endpoint> EndpointRequestBuilder<'a, E>
impl<'a, E: Endpoint> EndpointRequestBuilder<'a, E>
Sourcepub fn param(self, key: impl Into<String>, value: impl ToString) -> Self
pub fn param(self, key: impl Into<String>, value: impl ToString) -> Self
Sets a single path parameter.
Sourcepub fn query_pair(self, key: impl Into<String>, value: impl ToString) -> Self
pub fn query_pair(self, key: impl Into<String>, value: impl ToString) -> Self
Adds a query parameter.
Sourcepub fn header(
self,
key: impl AsRef<str>,
value: impl AsRef<str>,
) -> Result<Self>
pub fn header( self, key: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<Self>
Adds a request header.
Sourcepub fn bearer_token(self, token: impl Into<String>) -> Self
pub fn bearer_token(self, token: impl Into<String>) -> Self
Sets bearer authentication.
Sourcepub fn cancellation_token(self, token: CancellationToken) -> Self
pub fn cancellation_token(self, token: CancellationToken) -> Self
Attaches a cancellation token.
Sourcepub fn throw_on_error(self, throw: bool) -> Self
pub fn throw_on_error(self, throw: bool) -> Self
When true, send returns Err on non-2xx.
Sourcepub async fn send_json(self) -> Result<E::Response>
pub async fn send_json(self) -> Result<E::Response>
Executes and deserializes E::Response (feature json).
Sourcepub fn into_inner(self) -> RequestBuilder<'a>
pub fn into_inner(self) -> RequestBuilder<'a>
Returns the underlying RequestBuilder for advanced options.
Auto Trait Implementations§
impl<'a, E> !Freeze for EndpointRequestBuilder<'a, E>
impl<'a, E> !RefUnwindSafe for EndpointRequestBuilder<'a, E>
impl<'a, E> Send for EndpointRequestBuilder<'a, E>where
E: Send,
impl<'a, E> Sync for EndpointRequestBuilder<'a, E>where
E: Sync,
impl<'a, E> Unpin for EndpointRequestBuilder<'a, E>where
E: Unpin,
impl<'a, E> UnsafeUnpin for EndpointRequestBuilder<'a, E>
impl<'a, E> !UnwindSafe for EndpointRequestBuilder<'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