ducta 0.2.0

Experimental non-blocking HTTP server focused on explicit I/O state machines
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::http::{Request, Response};

pub trait Handler: Send + Sync + 'static {
    fn handle(&self, req: Request) -> Response;
}

// Automatically implement Handler for any function that matches the signature
impl<F> Handler for F 
where 
    F: Fn(Request) -> Response + Send + Sync + 'static 
{
    fn handle(&self, req: Request) -> Response {
        (self)(req)
    }
}