massively speed up compilation of garage_api_admin by not using async_trait

This commit is contained in:
Alex Auvolat
2025-02-05 19:37:38 +01:00
parent f914db057a
commit 7c8fc04b96
11 changed files with 4 additions and 68 deletions
+2 -5
View File
@@ -22,8 +22,6 @@ mod worker;
use std::sync::Arc;
use async_trait::async_trait;
use garage_model::garage::Garage;
pub use api_server::AdminApiServer as Admin;
@@ -34,13 +32,12 @@ pub enum Authorization {
AdminToken,
}
#[async_trait]
pub trait RequestHandler {
type Response;
async fn handle(
fn handle(
self,
garage: &Arc<Garage>,
admin: &Admin,
) -> Result<Self::Response, error::Error>;
) -> impl std::future::Future<Output = Result<Self::Response, error::Error>> + Send;
}