Struct HttpCall

Source
pub struct HttpCall<'a> {
    pub upstream: Upstream<'a>,
    pub headers: Vec<(&'a str, &'a [u8])>,
    pub trailers: Vec<(&'a str, &'a [u8])>,
    pub body: Option<&'a [u8]>,
    pub timeout: Option<Duration>,
    pub callback: Option<Box<dyn FnOnce(&mut DowncastBox<dyn RootContext>, &HttpCallResponse)>>,
}
Expand description

Outbound HTTP call

Fields§

§upstream: Upstream<'a>

Upstream cluster to send the request to.

§headers: Vec<(&'a str, &'a [u8])>

All headers to be sent along with the request. The proxy may add additional headers. This should include pseudo headers like :method and :path.

§trailers: Vec<(&'a str, &'a [u8])>

All trailers to be sent along with the request.

§body: Option<&'a [u8]>

An optional request body to send with the request.

§timeout: Option<Duration>

A timeout on waiting for a response. Default is 10 seconds.

§callback: Option<Box<dyn FnOnce(&mut DowncastBox<dyn RootContext>, &HttpCallResponse)>>

Callback to call when a response has arrived.

Implementations§

Source§

impl<'a> HttpCall<'a>

Source

pub fn dispatch(self) -> Result<(), Status>

Sends this HttpCall over the network.

Auto Trait Implementations§

§

impl<'a> Freeze for HttpCall<'a>

§

impl<'a> !RefUnwindSafe for HttpCall<'a>

§

impl<'a> !Send for HttpCall<'a>

§

impl<'a> !Sync for HttpCall<'a>

§

impl<'a> Unpin for HttpCall<'a>

§

impl<'a> !UnwindSafe for HttpCall<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.