1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#![warn(missing_docs)]
#[cfg(feature = "http02")]
pub mod http02;
mod internal;
pub mod node;
pub use node::Node;
#[derive(Debug, Clone, Copy)]
pub enum RoutingFailure {
NotFound,
MethodNotAllowed,
}
pub trait Request {
type Method: Eq + std::hash::Hash + Clone + Send + Sync;
fn path<'a>(&'a self) -> &'a str;
fn method<'a>(&'a self) -> &Self::Method;
}
impl Request for String {
type Method = ();
fn path(&self) -> &str {
&self
}
fn method(&self) -> &Self::Method {
&()
}
}