pub struct GatewayResponse {
pub status_code: u16,
pub headers: HashMap<String, Vec<String>>,
pub body: Bytes,
pub stream: Option<ResponseStream>,
}Expand description
The response under construction, ultimately returned to the client.
Fields§
§status_code: u16HTTP status code; 0 until a node (e.g. upstream or error-handler) sets it.
headers: HashMap<String, Vec<String>>Header name → list of values.
body: BytesResponse body, serialized as base64.
stream: Option<ResponseStream>Streaming body, when the upstream response is relayed unbuffered.
Skipped by serde: Context must stay serializable for Lua marshalling
and debug snapshots. Invariant: when this is Some, body is empty.
Set by the upstream node when a policy is inferred stream-capable at
compile time; read by the listener (build_response), which relays it
to the client instead of the buffered body.
Trait Implementations§
Source§impl Clone for GatewayResponse
impl Clone for GatewayResponse
Source§fn clone(&self) -> Self
fn clone(&self) -> Self
Cloning drops any stream: a stream has exactly one consumer, and every caller that clones a response (debug snapshots, cache stores) wants the buffered form.
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GatewayResponse
impl Debug for GatewayResponse
Source§impl<'de> Deserialize<'de> for GatewayResponse
impl<'de> Deserialize<'de> for GatewayResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for GatewayResponse
impl !RefUnwindSafe for GatewayResponse
impl !UnwindSafe for GatewayResponse
impl Send for GatewayResponse
impl Sync for GatewayResponse
impl Unpin for GatewayResponse
impl UnsafeUnpin for GatewayResponse
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more