pub struct Router { /* private fields */ }
Expand description
Router for Hyper.
Implementations§
Source§impl Router
impl Router
pub fn new() -> Self
Sourcepub fn add<S: Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture> + 'static>(
&mut self,
method: Method,
route: &str,
service: S,
) -> Result<(), Error>
pub fn add<S: Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture> + 'static>( &mut self, method: Method, route: &str, service: S, ) -> Result<(), Error>
Add a handler at the specific route path for the given Method
.
pub fn dispatch<'a>( &'a self, method: &Method, route_path: &str, ) -> Option<&'a Option<Route<Box<dyn Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture>>>>>
Trait Implementations§
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