pub struct Router<T: Clone> { /* private fields */ }
Expand description
路由器 路由支持静态, 动态, 通配符三种匹配方式 静态: /home/static 动态:/home/{name}.jpg, 每个段只支持一个参数 通配符:/home/{*all}, 参数all可以匹配多个段, *后面必须跟参数名,没有参数名不行 第一段可以不使用/, 比如“home/static“ 通配符需要位于路径的末尾 单线程版本
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Router<T>
impl<T> !RefUnwindSafe for Router<T>
impl<T> Send for Router<T>where
T: Send,
impl<T> Sync for Router<T>where
T: Sync,
impl<T> Unpin for Router<T>where
T: Unpin,
impl<T> UnwindSafe for Router<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more