roa-router 0.5.0-rc

router implementation for roa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod dispatcher;
mod guard;

use roa_core::http::{Method, StatusCode};
use roa_core::{throw, Result};

fn method_not_allowed(method: &Method) -> Result {
    throw!(
        StatusCode::METHOD_NOT_ALLOWED,
        format!("Method {} not allowed", method)
    )
}

pub use dispatcher::{
    connect, delete, get, head, options, patch, post, put, trace, Dispatcher,
};

pub use guard::{allow, deny, Guard};