Struct conjure_runtime::RequestBuilder[][src]

pub struct RequestBuilder<'a, T = DefaultRawClient> { /* fields omitted */ }

A builder for an asynchronous HTTP request.

Implementations

impl<'a, T> RequestBuilder<'a, T>[src]

pub fn headers_mut(&mut self) -> &mut HeaderMap[src]

Returns a mutable reference to the headers of this request.

The following headers are set by default, but can be overridden:

  • Accept-Encoding: gzip, deflate
  • Accept: */*
  • User-Agent: <provided at Client construction>

The following headers are fully controlled by conjure_runtime, which will overwrite any existing value.

  • Connection
  • Content-Length
  • Content-Type
  • Host
  • Proxy-Authorization
  • X-B3-Flags
  • X-B3-ParentSpanId
  • X-B3-Sampled
  • X-B3-SpanId
  • X-B3-TraceId

pub fn bearer_token(self, token: &BearerToken) -> Self[src]

Sets the Authorization request header to a bearer token.

This is a simple convenience wrapper.

pub fn param<U>(self, name: &str, value: U) -> Self where
    U: ToString
[src]

Adds a parameter.

Parameters which match names in the path pattern will be treated as path parameters, and other parameters will be treated as query parameters. Only one instance of path parameters may be provided, but multiple instances of query parameters may be provided.

pub fn idempotent(self, idempotent: bool) -> Self[src]

Sets the idempotency of the request.

Idempotent requests can be retried if an IO error is encountered.

The default value is controlled by the Idempotency enum.

pub fn body<U>(self, body: U) -> Self where
    U: Body + Sync + Send + 'a, 
[src]

Sets the request body.

impl<'a, T, B> RequestBuilder<'a, T> where
    T: Service<Request<RawBody>, Response = Response<B>> + 'static + Sync + Send,
    T::Error: Into<Box<dyn Error + Sync + Send>>,
    T::Future: Send,
    B: Body<Data = Bytes> + Send,
    B::Error: Into<Box<dyn Error + Sync + Send>>, 
[src]

pub async fn send(self) -> Result<Response<B>, Error>[src]

Makes the request.

Auto Trait Implementations

impl<'a, T = DefaultRawClient> !RefUnwindSafe for RequestBuilder<'a, T>

impl<'a, T> Send for RequestBuilder<'a, T> where
    T: Send + Sync

impl<'a, T> Sync for RequestBuilder<'a, T> where
    T: Send + Sync

impl<'a, T> Unpin for RequestBuilder<'a, T>

impl<'a, T = DefaultRawClient> !UnwindSafe for RequestBuilder<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,