pub struct JsonResponse<T = Nothing, M = Nothing> {
pub status: StatusCode,
pub content: T,
pub meta: M,
}
Fields§
§status: StatusCode
§content: T
§meta: M
Implementations§
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> Default for JsonResponse<T, M>
impl<T, M> Default for JsonResponse<T, M>
Source§impl<T, M> Display for JsonResponse<T, M>
impl<T, M> Display for JsonResponse<T, M>
Source§impl<T, M> IntoResponse for JsonResponse<T, M>
impl<T, M> IntoResponse for JsonResponse<T, M>
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl<T, M> Freeze for JsonResponse<T, M>
impl<T, M> RefUnwindSafe for JsonResponse<T, M>where
T: RefUnwindSafe,
M: RefUnwindSafe,
impl<T, M> Send for JsonResponse<T, M>
impl<T, M> Sync for JsonResponse<T, M>
impl<T, M> Unpin for JsonResponse<T, M>
impl<T, M> UnwindSafe for JsonResponse<T, M>where
T: UnwindSafe,
M: UnwindSafe,
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