pub struct Router { /* private fields */ }Expand description
Matchit-based router.
Implementations§
Trait Implementations§
Source§impl IRouter for Router
impl IRouter for Router
Source§fn register(
&mut self,
method: HttpMethod,
path: &str,
endpoint: Arc<dyn IEndpoint>,
)
fn register( &mut self, method: HttpMethod, path: &str, endpoint: Arc<dyn IEndpoint>, )
Register a new route with the router.
Source§fn match_route<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut dyn IHttpContext,
) -> Pin<Box<dyn Future<Output = Result<Option<(Arc<dyn IEndpoint>, HashMap<String, String>, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn match_route<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut dyn IHttpContext,
) -> Pin<Box<dyn Future<Output = Result<Option<(Arc<dyn IEndpoint>, HashMap<String, String>, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Match an incoming request to a registered endpoint. Read more
Auto Trait Implementations§
impl !Freeze for Router
impl !RefUnwindSafe for Router
impl !UnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnsafeUnpin 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