pub struct HttpResponse {
pub status: StatusCode,
pub payload: HttpResponsePayload,
pub headers: Vec<(String, String)>,
}Expand description
A HTTP response Original http response from actix_web can not be shared between threads and cant be used inside async blocks This struct is a wrapper around actix_web::HttpResponse that can be shared between threads.
Fields§
§status: StatusCode§payload: HttpResponsePayload§headers: Vec<(String, String)>Implementations§
Source§impl HttpResponse
impl HttpResponse
pub fn BadRequest() -> HttpResponseBuilder
Source§impl HttpResponse
impl HttpResponse
pub fn Ok() -> HttpResponseBuilder
Source§impl HttpResponse
impl HttpResponse
pub fn Created() -> HttpResponseBuilder
Source§impl HttpResponse
impl HttpResponse
pub fn NotFound() -> HttpResponseBuilder
Trait Implementations§
Source§impl ApiComponent for HttpResponse
impl ApiComponent for HttpResponse
Source§fn child_schemas() -> Vec<(String, ReferenceOr<Schema>)>
fn child_schemas() -> Vec<(String, ReferenceOr<Schema>)>
Contains children schemas for this operation
Each child can also contain child schemas
fn schema() -> Option<(String, ReferenceOr<Schema>)>
fn content_type() -> String
fn required() -> bool
fn raw_schema() -> Option<ReferenceOr<Schema>>
fn securities() -> BTreeMap<String, SecurityScheme>
fn security_requirement_name() -> Option<String>
fn request_body() -> Option<RequestBody>
fn error_responses() -> Vec<(String, Response)>
fn error_schemas() -> BTreeMap<String, (String, ReferenceOr<Schema>)>
fn responses(_content_type: Option<String>) -> Option<Responses>
fn parameters() -> Vec<Parameter>
Source§impl Responder for HttpResponse
impl Responder for HttpResponse
type Body = BoxBody
Source§fn respond_to(self, _req: &HttpRequest) -> HttpResponse<Self::Body>
fn respond_to(self, _req: &HttpRequest) -> HttpResponse<Self::Body>
Convert self to
HttpResponse.Auto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin for HttpResponse
impl UnwindSafe for HttpResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DefaultParameterAccessor for Twhere
T: ApiComponent,
impl<T> DefaultParameterAccessor for Twhere
T: ApiComponent,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more