Struct ajars_reqwest::RequestBuilder
source · [−]pub struct RequestBuilder<'a, I: Serialize + DeserializeOwned, O: Serialize + DeserializeOwned, REST: RestType<I, O>> { /* private fields */ }
Implementations
sourceimpl<'a, I: Serialize + DeserializeOwned, O: Serialize + DeserializeOwned, REST: RestType<I, O>> RequestBuilder<'a, I, O, REST>
impl<'a, I: Serialize + DeserializeOwned, O: Serialize + DeserializeOwned, REST: RestType<I, O>> RequestBuilder<'a, I, O, REST>
sourcepub async fn send(self, data: &I) -> Result<O, Error>
pub async fn send(self, data: &I) -> Result<O, Error>
Sends the Request to the target URL, returning a future Response.
sourcepub fn header<K, V>(self, key: K, value: V) -> Self where
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
pub fn header<K, V>(self, key: K, value: V) -> Self where
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
HeaderValue: TryFrom<V>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
Add a Header
to this Request.
sourcepub fn headers(self, headers: HeaderMap) -> Self
pub fn headers(self, headers: HeaderMap) -> Self
Add a set of Headers to the existing ones on this Request.
The headers will be merged in to any already set.
sourcepub fn basic_auth<U, P>(self, username: U, password: Option<P>) -> Self where
U: Display,
P: Display,
pub fn basic_auth<U, P>(self, username: U, password: Option<P>) -> Self where
U: Display,
P: Display,
Enable HTTP basic authentication.
sourcepub fn bearer_auth<T>(self, token: T) -> Self where
T: Display,
pub fn bearer_auth<T>(self, token: T) -> Self where
T: Display,
Enable HTTP bearer authentication.
Auto Trait Implementations
impl<'a, I, O, REST> !RefUnwindSafe for RequestBuilder<'a, I, O, REST>
impl<'a, I, O, REST> Send for RequestBuilder<'a, I, O, REST> where
I: Send,
O: Send,
REST: Sync,
impl<'a, I, O, REST> Sync for RequestBuilder<'a, I, O, REST> where
I: Sync,
O: Sync,
REST: Sync,
impl<'a, I, O, REST> Unpin for RequestBuilder<'a, I, O, REST> where
I: Unpin,
O: Unpin,
impl<'a, I, O, REST> !UnwindSafe for RequestBuilder<'a, I, O, REST>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more