[][src]Function bravery_router::find

pub fn find<'req, T: Clone>(
    node: &'req Node<T>,
    path: &'req str
) -> FindResult<'req, T>

Find in the radix tree the path and return a FindResult.

There're some precendence:

  1. every Static nodes are compared
  2. then every Regex nodes are compared
  3. then the Wildcard is applied

Examples

use bravery_router::{create_root_node, add, find};
let mut node = create_root_node();
add(&mut node, "/foo", 1);

let find_result = find(&node, "/foo").value.unwrap();