pub struct PathTable<R> { /* private fields */ }
Expand description
A generic path-based routing table, terminating with resources R
.
Implementations§
Source§impl<R> PathTable<R>
impl<R> PathTable<R>
Sourcepub fn resource_mut(&mut self) -> &mut Option<R>
pub fn resource_mut(&mut self) -> &mut Option<R>
Retrieve a mutable reference of the resource.
Sourcepub fn iter_mut(&mut self) -> ResourcesMut<'_, R> ⓘ
pub fn iter_mut(&mut self) -> ResourcesMut<'_, R> ⓘ
Return a mutable iterator of all resources.
Sourcepub fn route<'a>(&'a self, path: &'a str) -> Option<(&'a R, RouteMatch<'a>)>
pub fn route<'a>(&'a self, path: &'a str) -> Option<(&'a R, RouteMatch<'a>)>
Determine which resource, if any, the concrete path
should be routed to.
Sourcepub fn setup_table(&mut self, path: &str) -> &mut PathTable<R>
pub fn setup_table(&mut self, path: &str) -> &mut PathTable<R>
Return the table of the given routing path (which may contain wildcards).
If it doesn’t already exist, this will make a new one.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for PathTable<R>where
R: Freeze,
impl<R> RefUnwindSafe for PathTable<R>where
R: RefUnwindSafe,
impl<R> Send for PathTable<R>where
R: Send,
impl<R> Sync for PathTable<R>where
R: Sync,
impl<R> Unpin for PathTable<R>where
R: Unpin,
impl<R> UnwindSafe for PathTable<R>where
R: UnwindSafe,
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