pub struct OutgoingResponse { /* private fields */ }
Expand description
Represents an outgoing HTTP Response.
Implementations§
Source§impl OutgoingResponse
impl OutgoingResponse
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Get the HTTP Status Code for the Response.
Source§impl OutgoingResponse
impl OutgoingResponse
Sourcepub fn set_status_code(&self, status_code: StatusCode) -> Result<(), ()>
pub fn set_status_code(&self, status_code: StatusCode) -> Result<(), ()>
Set the HTTP Status Code for the Response. Fails if the status-code given is not a valid http status code.
Source§impl OutgoingResponse
impl OutgoingResponse
Sourcepub fn headers(&self) -> Headers
pub fn headers(&self) -> Headers
Get the headers associated with the Request.
The returned headers
resource is immutable: set
, append
, and
delete
operations will fail with header-error.immutable
.
This headers resource is a child: it must be dropped before the parent
outgoing-request
is dropped, or its ownership is transfered to
another component by e.g. outgoing-handler.handle
.
Source§impl OutgoingResponse
impl OutgoingResponse
Sourcepub fn body(&self) -> Result<OutgoingBody, ()>
pub fn body(&self) -> Result<OutgoingBody, ()>
Returns the resource corresponding to the outgoing Body for this Response.
Returns success on the first call: the outgoing-body
resource for
this outgoing-response
can be retrieved at most once. Subsequent
calls will return error.