pub enum ApiResponse<T> {
Success(T),
Error(String),
}
Variants§
Trait Implementations§
Source§impl<T: Serialize> Responder for ApiResponse<T>
impl<T: Serialize> Responder for ApiResponse<T>
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<T> Freeze for ApiResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for ApiResponse<T>where
T: RefUnwindSafe,
impl<T> Send for ApiResponse<T>where
T: Send,
impl<T> Sync for ApiResponse<T>where
T: Sync,
impl<T> Unpin for ApiResponse<T>where
T: Unpin,
impl<T> UnwindSafe for ApiResponse<T>where
T: 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