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