pub struct RouteTable<T> { /* private fields */ }Expand description
Simple route table for path matching.
This provides O(n) matching but with full converter support. For larger applications, consider using fastapi-router’s trie.
Implementations§
Source§impl<T> RouteTable<T>
impl<T> RouteTable<T>
Sourcepub fn lookup(&self, path: &str, method: Method) -> RouteLookup<'_, T>
pub fn lookup(&self, path: &str, method: Method) -> RouteLookup<'_, T>
Look up a route by path and method.
Sourcepub fn lookup_with_trailing_slash(
&self,
path: &str,
method: Method,
mode: TrailingSlashMode,
) -> RouteLookup<'_, T>
pub fn lookup_with_trailing_slash( &self, path: &str, method: Method, mode: TrailingSlashMode, ) -> RouteLookup<'_, T>
Look up a route by path and method, with trailing slash handling.
This extends lookup with trailing slash normalization based on the mode:
Strict: Exact match requiredRedirect: Redirect trailing slash to no trailing slashRedirectWithSlash: Redirect no trailing slash to with trailing slashMatchBoth: Accept both forms without redirect
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for RouteTable<T>
impl<T> RefUnwindSafe for RouteTable<T>where
T: RefUnwindSafe,
impl<T> Send for RouteTable<T>where
T: Send,
impl<T> Sync for RouteTable<T>where
T: Sync,
impl<T> Unpin for RouteTable<T>where
T: Unpin,
impl<T> UnwindSafe for RouteTable<T>where
T: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).