Struct hyper_routing::Router
source · [−]pub struct Router { /* private fields */ }Expand description
This is the one. The router.
Implementations
sourceimpl Router
impl Router
sourcepub fn find_handler_with_defaults(&self, request: &Request<Body>) -> Handler
pub fn find_handler_with_defaults(&self, request: &Request<Body>) -> Handler
Finds handler for given Hyper request.
This method uses default error handlers. If the request does not match any route than default 404 handler is returned. If the request match some routes but http method does not match (used GET but routes are defined for POST) than default method not supported handler is returned.
sourcepub fn find_handler(&self, request: &Request<Body>) -> HttpResult<Handler>
pub fn find_handler(&self, request: &Request<Body>) -> HttpResult<Handler>
Finds handler for given Hyper request.
It returns handler if it’s found or StatusCode for error.
This method may return NotFound, MethodNotAllowed or NotImplemented
status codes.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more