Struct ntex::web::WebResponse [−][src]
pub struct WebResponse { /* fields omitted */ }
Expand description
An service http response
Implementations
Create web response instance
pub fn from_err<Err: ErrorRenderer, E: Into<Err::Container>>(
err: E,
request: HttpRequest
) -> Self
pub fn from_err<Err: ErrorRenderer, E: Into<Err::Container>>(
err: E,
request: HttpRequest
) -> Self
Create web response from the error
Create web response for error
Create web response
Get reference to original request
Get mutable reference to response
Get the response status code
Returns mutable response’s headers.
pub fn checked_expr<Err, F, E>(self, f: F) -> Self where
F: FnOnce(&mut Self) -> Result<(), E>,
E: Into<Err::Container>,
Err: ErrorRenderer,
pub fn checked_expr<Err, F, E>(self, f: F) -> Self where
F: FnOnce(&mut Self) -> Result<(), E>,
E: Into<Err::Container>,
Err: ErrorRenderer,
Execute closure and in case of error convert it to response.
Extract response body
pub fn map_body<F>(self, f: F) -> WebResponse where
F: FnOnce(&mut ResponseHead, ResponseBody<Body>) -> ResponseBody<Body>,
pub fn map_body<F>(self, f: F) -> WebResponse where
F: FnOnce(&mut ResponseHead, ResponseBody<Body>) -> ResponseBody<Body>,
Set a new body
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for WebResponse
impl !Send for WebResponse
impl !Sync for WebResponse
impl Unpin for WebResponse
impl !UnwindSafe for WebResponse
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more