Struct ntex::http::Response [−][src]
pub struct Response<B = Body> { /* fields omitted */ }
Expand description
An HTTP Response
Implementations
Create http response builder with specific status.
Create http response builder
Constructs a response
Constructs a response with body
Http message part of the response
Mutable reference to a http message part of the response
Get the response status code
Set the StatusCode
for this response
Get a mutable reference to the headers
Get an iterator for the cookies set by this response
Add a cookie to this response
Remove all cookies with the given name from this response. Returns the number of cookies removed.
Keep-alive status for this connection
Responses extensions
Mutable reference to a the response’s extensions
Get body of this response
Split response and body
pub fn map_body<F, B2>(self, f: F) -> Response<B2> where
F: FnOnce(&mut ResponseHead, ResponseBody<B>) -> ResponseBody<B2>,
pub fn map_body<F, B2>(self, f: F) -> Response<B2> where
F: FnOnce(&mut ResponseHead, ResponseBody<B>) -> ResponseBody<B2>,
Set a body and return previous body value
Extract response body
Trait Implementations
Get content encoding
Set content encoding
Performs the conversion.
Convert Response
to a ResponseBuilder
. Body get dropped.
Performs the conversion.
Performs the conversion.
Helper converters
Performs the conversion.
Convert itself to AsyncResult
or Error
.
Override a status code for a Responder. Read more
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self, Err> where
Self: Sized,
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
<HeaderValue as TryFrom<V>>::Error: Into<HttpError>,
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self, Err> where
Self: Sized,
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
<HeaderValue as TryFrom<V>>::Error: Into<HttpError>,
Add header to the Responder’s response. Read more
Auto Trait Implementations
impl<B = Body> !RefUnwindSafe for Response<B>
impl<B = Body> !UnwindSafe for Response<B>
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