(r: Result<T>)
| 31 | } |
| 32 | |
| 33 | fn to_json<T: Serialize>(r: Result<T>) -> Json<Response<T>> { |
| 34 | match r { |
| 35 | Ok(data) => Json(Response::Data(data)), |
| 36 | Err(e) => Json(Response::Error(format!("{e:?}"))), |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | #[post("/deploy", data = "<config>")] |
| 41 | async fn deploy(supervisor: &State<Supervisor>, config: Json<ProcessConfig>) -> Json<Response<()>> { |