pub struct Router { /* private fields */ }Implementations§
Source§impl Router
impl Router
pub fn new() -> Self
pub fn register( &mut self, method: RequestMethod, route: &str, action: Box<dyn Fn(HashMap<String, String>) -> Pin<Box<dyn Future<Output = ()>>>>, )
pub async fn resolve( &self, method: RequestMethod, route: &str, action_args: Option<HashMap<String, String>>, ) -> bool
pub async fn redirect(&self, path: &str) -> bool
Auto Trait Implementations§
impl Freeze for Router
impl !RefUnwindSafe for Router
impl !Send for Router
impl !Sync for Router
impl Unpin for Router
impl !UnwindSafe for Router
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