[][src]Struct turbofish::router::Node

pub struct Node<V> { /* fields omitted */ }

A node in radix tree ordered by priority priority is just the number of values registered in sub nodes (children, grandchildren, and so on..).

Implementations

impl<V> Node<V>[src]

pub fn add_route(&mut self, path: &str, value: V)[src]

add_route adds a node with the given value to the path.

pub fn get_value(&self, path: &str) -> Result<RouteLookup<'_, V>, bool>[src]

Returns the value registered with the given path (key). The values of wildcards are saved to a map. If no value can be found, a TSR (trailing slash redirect) recommendation is made if a value exists with an extra (without the) trailing slash for the given path.

pub fn find_case_insensitive_path(
    &self,
    path: &str,
    fix_trailing_slash: bool
) -> Option<String>
[src]

Makes a case-insensitive lookup of the given path and tries to find a handler. It can optionally also fix trailing slashes. It returns the case-corrected path and a bool indicating whether the lookup was successful.

Trait Implementations

impl<V> Default for Node<V>[src]

Auto Trait Implementations

impl<V> RefUnwindSafe for Node<V> where
    V: RefUnwindSafe

impl<V> Send for Node<V> where
    V: Send

impl<V> Sync for Node<V> where
    V: Sync

impl<V> Unpin for Node<V> where
    V: Unpin

impl<V> UnwindSafe for Node<V> where
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.