#[async_trait::async_trait]
pub trait NgynController: Send + Sync {
fn new(middlewares: Vec<std::sync::Arc<dyn super::NgynMiddleware>>) -> Self
where
Self: Sized;
fn get_routes(&self) -> Vec<(String, String, String)>;
async fn handle(
&self,
handler: String,
req: &mut crate::NgynRequest,
res: &mut crate::NgynResponse,
);
}
#[async_trait::async_trait]
pub trait NgynControllerRoutePlaceholder {
#[allow(non_upper_case_globals)]
const routes: &'static [(&'static str, &'static str, &'static str)];
async fn __handle_route(
&self,
handler: String,
req: &mut crate::NgynRequest,
res: &mut crate::NgynResponse,
);
}