toni 0.1.1

Fast and modular web framework for scalable applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::sync::Arc;

use anyhow::Result;

use crate::http_helpers::HttpMethod;
use crate::traits_helpers::ControllerTrait;

pub trait HttpAdapter: Clone + Send + Sync {
    fn new() -> Self;
    fn add_route(&mut self, path: &str, method: HttpMethod, handler: Arc<Box<dyn ControllerTrait>>);
    fn listen(self, port: u16, hostname: &str) -> impl Future<Output = Result<()>> + Send;
}