[−][src]Struct reroute::Router
The Router struct contains the information for your app to route requests properly based on their HTTP method and matching route. It allows the use of a custom 404 handler if desired but provides a default as well.
Under the hood a Router uses a RegexSet
to match URI's that come in to the
instance of the hyper server. Because of this, it has the potential to match
multiple patterns that you provide. It will call the first handler that it
matches against so the order in which you add routes matters.
Methods
impl Router
[src]
pub fn handle(&self, req: Request<Body>) -> Response<Body>
[src]
This function should be called inside of a hyper service. It will find the correct handler for the given route and handle errors appropriately.
Auto Trait Implementations
impl !RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl !UnwindSafe for Router
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,