-
SummaryI need to use a let result = local.run_until(async {
match route_merchant(from.unwrap().as_str(), to.unwrap().as_str(), entity.as_str(), limits, &state.db).await {
Ok(instructions) => {
let instructions = instructions.clone();
let json = json!({ "instructions": instructions });
(StatusCode::OK, axum::Json(json))
}
Err(e) => (StatusCode::BAD_REQUEST, axum::Json(json!({"error": e}))),
}
}).await;
pub async fn route_merchant(departure_merchant: &str, arrival_merchant: &str, entity_id: &str, limits: ConnectivityLimits, db: &Database) -> Result<Vec<InstructionType>, NavigationError> {
let alloc = Bump::default();
// Some logics
entity.navigate(src, dest, limits, &alloc)
}axum version0.8.6 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
It's hard to say anything with this little information. What's the error? |
Beta Was this translation helpful? Give feedback.
-
|
It seems that the |
Beta Was this translation helpful? Give feedback.
It seems that the
Bumpdoesn't implementSend + Sync, so it can't serve as the handler in this scenario. Simply useblock_onto execute logic that requiresBumpinstead.