Struct json_resp::JsonResponse
source · pub struct JsonResponse<T = Nothing, M = Nothing> {
pub status: StatusCode,
pub content: T,
pub meta: M,
}Fields§
§status: StatusCode§content: T§meta: MImplementations§
source§impl JsonResponse
impl JsonResponse
source§impl<T> JsonResponse<T>
impl<T> JsonResponse<T>
pub fn with_content(content: T) -> Self
source§impl<T, M> JsonResponse<T, M>
impl<T, M> JsonResponse<T, M>
pub fn content<T2>(self, content: T2) -> JsonResponse<T2, M>
pub fn meta<M2>(self, meta: M2) -> JsonResponse<T, M2>
Trait Implementations§
source§impl<T, M> IntoResponse for JsonResponse<T, M>where
T: Serialize,
M: Serialize,
impl<T, M> IntoResponse for JsonResponse<T, M>where T: Serialize, M: Serialize,
source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.