pub struct EndpointRequestBuilder<'a, E: Endpoint, S> { /* private fields */ }Expand description
Fluent builder for a typed Endpoint.
When E::Params is not [()], the builder starts in NeedsParams and requires
.params() before .send_json().
Implementations§
Source§impl<'a, E: Endpoint> EndpointRequestBuilder<'a, E, NeedsParams>
impl<'a, E: Endpoint> EndpointRequestBuilder<'a, E, NeedsParams>
Source§impl<'a, E: Endpoint> EndpointRequestBuilder<'a, E, Ready>
impl<'a, E: Endpoint> EndpointRequestBuilder<'a, E, Ready>
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>
Available on crate feature json only.
pub async fn send_json(self) -> Result<E::Response>
json only.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, S> !Freeze for EndpointRequestBuilder<'a, E, S>
impl<'a, E, S> !RefUnwindSafe for EndpointRequestBuilder<'a, E, S>
impl<'a, E, S> Send for EndpointRequestBuilder<'a, E, S>
impl<'a, E, S> Sync for EndpointRequestBuilder<'a, E, S>
impl<'a, E, S> Unpin for EndpointRequestBuilder<'a, E, S>
impl<'a, E, S> UnsafeUnpin for EndpointRequestBuilder<'a, E, S>
impl<'a, E, S> !UnwindSafe for EndpointRequestBuilder<'a, E, S>
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