pub type HttpResponse = Response;
Expand description
Type alias for the HTTP response type that the orchestrator uses.
Aliased Type§
struct HttpResponse { /* private fields */ }
Implementations
Source§impl<B> Response<B>
impl<B> Response<B>
Sourcepub fn try_into_http02x(self) -> Result<Response<B>, HttpError>
pub fn try_into_http02x(self) -> Result<Response<B>, HttpError>
Converts this response into an http 0.x response.
Depending on the internal storage type, this operation may be free or it may have an internal cost.
Sourcepub fn try_into_http1x(self) -> Result<Response<B>, HttpError>
pub fn try_into_http1x(self) -> Result<Response<B>, HttpError>
Converts this response into an http 1.x response.
Depending on the internal storage type, this operation may be free or it may have an internal cost.
Sourcepub fn map<U>(self, f: impl Fn(B) -> U) -> Response<U>
pub fn map<U>(self, f: impl Fn(B) -> U) -> Response<U>
Update the body of this response to be a new body.
Sourcepub fn new(status: StatusCode, body: B) -> Response<B>
pub fn new(status: StatusCode, body: B) -> Response<B>
Returns a response with the given status and body
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Returns the status code
Sourcepub fn status_mut(&mut self) -> &mut StatusCode
pub fn status_mut(&mut self) -> &mut StatusCode
Returns a mutable reference to the status code
Sourcepub fn headers_mut(&mut self) -> &mut Headers
pub fn headers_mut(&mut self) -> &mut Headers
Returns a mutable reference to the header map
Sourcepub fn add_extension<T>(&mut self, extension: T)
pub fn add_extension<T>(&mut self, extension: T)
Adds an extension to the response extensions