actix_cloud::response

Type Alias JsonResponse

Source
pub type JsonResponse = Response<Value>;
Available on crate features response and response-json only.

Aliased Type§

struct JsonResponse {
    pub http_code: u16,
    pub code: i64,
    pub message: String,
    pub data: Option<Value>,
    pub builder: Option<Box<dyn Fn(&mut HttpResponseBuilder)>>,
    pub translate: bool,
}

Fields§

§http_code: u16§code: i64§message: String§data: Option<Value>§builder: Option<Box<dyn Fn(&mut HttpResponseBuilder)>>§translate: bool
Available on crate feature i18n only.

Implementations§

Source§

impl JsonResponse

Source

pub fn json<T: Serialize>(self, data: T) -> Self

Trait Implementations§

Source§

impl Responder for JsonResponse

Source§

type Body = EitherBody<String>

Source§

fn respond_to(self, req: &HttpRequest) -> HttpResponse<Self::Body>

Convert self to HttpResponse.
Source§

fn customize(self) -> CustomizeResponder<Self>
where Self: Sized,

Wraps responder to allow alteration of its response. Read more