mirror of
https://github.com/fafhrd91/actix-web
synced 2025-05-20 07:43:19 +02:00
33 lines
562 B
Rust
33 lines
562 B
Rust
//! Resource path matching library.
|
|
mod de;
|
|
mod path;
|
|
mod pattern;
|
|
mod router;
|
|
|
|
pub use self::de::PathDeserializer;
|
|
pub use self::path::Path;
|
|
pub use self::pattern::Pattern;
|
|
pub use self::router::{Router, RouterBuilder};
|
|
|
|
pub trait RequestPath {
|
|
fn path(&self) -> &str;
|
|
}
|
|
|
|
impl RequestPath for String {
|
|
fn path(&self) -> &str {
|
|
self.as_str()
|
|
}
|
|
}
|
|
|
|
impl<'a> RequestPath for &'a str {
|
|
fn path(&self) -> &str {
|
|
self
|
|
}
|
|
}
|
|
|
|
impl<T: AsRef<[u8]>> RequestPath for string::String<T> {
|
|
fn path(&self) -> &str {
|
|
&*self
|
|
}
|
|
}
|