#[non_exhaustive]pub struct Response {
pub code: i64,
pub size: i64,
pub headers: HashMap<String, String>,
pub time: Option<Timestamp>,
pub backend_latency: Option<Duration>,
}Expand description
This message defines attributes for a typical network response. It generally models semantics of an HTTP response.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: i64The HTTP response status code, such as 200 and 404.
size: i64The HTTP response size in bytes. If unknown, it must be -1.
headers: HashMap<String, String>The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
time: Option<Timestamp>The timestamp when the destination service sends the last byte of
the response.
backend_latency: Option<Duration>The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
Implementations§
Source§impl Response
impl Response
pub fn new() -> Self
Sourcepub fn set_backend_latency<T: Into<Option<Duration>>>(self, v: T) -> Self
pub fn set_backend_latency<T: Into<Option<Duration>>>(self, v: T) -> Self
Sets the value of backend_latency.
Sourcepub fn set_headers<T, K, V>(self, v: T) -> Self
pub fn set_headers<T, K, V>(self, v: T) -> Self
Sets the value of headers.