[−][src]Struct turbofish::router::Router
Router is container which can be used to dispatch requests to different handler functions via configurable routes
Fields
map: HashMap<K, Node<V>>
Implementations
impl<K: Eq + Hash, V> Router<K, V>
[src]
pub fn with_capacity(capacity: usize) -> Self
[src]
pub fn add(&mut self, key: K, value: V, path: &str)
[src]
Add registers a new request handle with the given key and value in the route map
pub fn lookup(
&mut self,
key: &K,
path: &str
) -> Result<RouteLookup<'_, V>, bool>
[src]
&mut self,
key: &K,
path: &str
) -> Result<RouteLookup<'_, V>, bool>
Allows the manual lookup of a path in the route map. Returns the value and the path parameter values if the path is found. If no match can be found, a TSR (trailing slash redirect) recommendation is made if a match exists with an extra (without the) trailing slash for the given path.
Trait Implementations
Auto Trait Implementations
impl<K, V> RefUnwindSafe for Router<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Router<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for Router<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for Router<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for Router<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,