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§
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> 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