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§
Trait Implementations§
Source§impl Responder for JsonResponse
impl Responder for JsonResponse
type Body = EitherBody<String>
Source§fn respond_to(self, req: &HttpRequest) -> HttpResponse<Self::Body>
fn respond_to(self, req: &HttpRequest) -> HttpResponse<Self::Body>
Convert self to
HttpResponse
.