pub struct Routes { /* private fields */ }
Expand description
A collection of routes that can be mounted on a router. This isn’t where the endpoints are stored, but is instead an index to track those endpoints.
Implementations§
Source§impl Routes
impl Routes
Sourcepub fn at<'route, 'path>(
&'route self,
path: &'path str,
) -> Option<(&'route RouteId, Path<'route, 'path>)>
pub fn at<'route, 'path>( &'route self, path: &'path str, ) -> Option<(&'route RouteId, Path<'route, 'path>)>
Get the route ID for a given path.
Sourcepub fn insert(&mut self, route: impl Into<String>, value: RouteId)
pub fn insert(&mut self, route: impl Into<String>, value: RouteId)
Insert a route into the router.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Routes
impl RefUnwindSafe for Routes
impl Send for Routes
impl Sync for Routes
impl Unpin for Routes
impl UnwindSafe for Routes
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