rustful 0.2.1

A light web micro-framework with some REST-like features and the ambition of being simple, modular and non-intrusive.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//!Request handlers.

use context::Context;
use response::Response;

///A trait for request handlers.
pub trait Handler: Send + Sync + 'static {
    fn handle_request(&self, context: Context, response: Response);
}

impl<F: Fn(Context, Response) + Send + Sync + 'static> Handler for F {
    fn handle_request(&self, context: Context, response: Response) {
        self(context, response);
    }
}