Struct ajars_actix_web::actix_web::dev::ServiceResponse [−][src]
pub struct ServiceResponse<B = AnyBody> { /* fields omitted */ }
Implementations
pub fn from_err<E>(err: E, request: HttpRequest) -> ServiceResponse<AnyBody> where
E: Into<Error>,
pub fn from_err<E>(err: E, request: HttpRequest) -> ServiceResponse<AnyBody> where
E: Into<Error>,
Create service response from the error
Create service response instance
Create service response for error
Create service response
Get reference to original request
pub fn response(&self) -> &HttpResponse<B>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
pub fn response(&self) -> &HttpResponse<B>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Get reference to response
pub fn response_mut(&mut self) -> &mut HttpResponse<B>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
pub fn response_mut(&mut self) -> &mut HttpResponse<B>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Get mutable reference to response
Get the response status code
Returns mutable response’s headers.
pub fn checked_expr<F, E>(self, f: F) -> Result<ServiceResponse<B>, Error> where
E: Into<Error>,
F: FnOnce(&mut ServiceResponse<B>) -> Result<(), E>,
pub fn checked_expr<F, E>(self, f: F) -> Result<ServiceResponse<B>, Error> where
E: Into<Error>,
F: FnOnce(&mut ServiceResponse<B>) -> Result<(), E>,
Execute closure and in case of error convert it to response.
pub fn map_body<F, B2>(self, f: F) -> ServiceResponse<B2> where
F: FnOnce(&mut ResponseHead, B) -> B2,
pub fn map_body<F, B2>(self, f: F) -> ServiceResponse<B2> where
F: FnOnce(&mut ResponseHead, B) -> B2,
Set a new body
Trait Implementations
impl<B> Debug for ServiceResponse<B> where
B: MessageBody,
<B as MessageBody>::Error: Into<Error>,
impl<B> Debug for ServiceResponse<B> where
B: MessageBody,
<B as MessageBody>::Error: Into<Error>,
Performs the conversion.
pub fn from(res: ServiceResponse<B>) -> HttpResponse<B>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
pub fn from(res: ServiceResponse<B>) -> HttpResponse<B>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Performs the conversion.
Auto Trait Implementations
impl<B = AnyBody> !RefUnwindSafe for ServiceResponse<B>
impl<B = AnyBody> !Send for ServiceResponse<B>
impl<B = AnyBody> !Sync for ServiceResponse<B>
impl<B> Unpin for ServiceResponse<B> where
B: Unpin,
impl<B = AnyBody> !UnwindSafe for ServiceResponse<B>