[−][src]Struct ntex::web::dev::WebResponse
An service http response
Methods
impl WebResponse
[src]
pub fn new(response: Response<Body>, request: HttpRequest) -> Self
[src]
Create web response instance
pub fn from_err<Err: ErrorRenderer, E: Into<Err::Container>>(
err: E,
request: HttpRequest
) -> Self
[src]
err: E,
request: HttpRequest
) -> Self
Create web response from the error
pub fn error_response<Err: ErrorRenderer, E: Into<Err::Container>>(
self,
err: E
) -> Self
[src]
self,
err: E
) -> Self
Create web response for error
pub fn into_response(self, response: Response) -> WebResponse
[src]
Create web response
pub fn request(&self) -> &HttpRequest
[src]
Get reference to original request
pub fn response(&self) -> &Response<Body>
[src]
Get reference to response
pub fn response_mut(&mut self) -> &mut Response<Body>
[src]
Get mutable reference to response
pub fn status(&self) -> StatusCode
[src]
Get the response status code
pub fn headers(&self) -> &HeaderMap
[src]
Returns response's headers.
pub fn headers_mut(&mut self) -> &mut HeaderMap
[src]
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,
[src]
F: FnOnce(&mut Self) -> Result<(), E>,
E: Into<Err::Container>,
Err: ErrorRenderer,
Execute closure and in case of error convert it to response.
pub fn take_body(&mut self) -> ResponseBody<Body>
[src]
Extract response body
impl WebResponse
[src]
pub fn map_body<F>(self, f: F) -> WebResponse where
F: FnOnce(&mut ResponseHead, ResponseBody<Body>) -> ResponseBody<Body>,
[src]
F: FnOnce(&mut ResponseHead, ResponseBody<Body>) -> ResponseBody<Body>,
Set a new body
Trait Implementations
impl Debug for WebResponse
[src]
impl Into<Response<Body>> for WebResponse
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,