Struct path_router::Tree [] [src]

pub struct Tree<'a, T> { /* fields omitted */ }

The routing information is stored as a trie.

Description

Each node is labelled with its path segment. The value is a tuple. The first element is generic, and is usually a handler function; the second element is the captured path segments.

Methods

impl<'a, T> Tree<'a, T>
[src]

Constructs a new routing tree.

Adds a new path and its associated value to the tree. Prefix a segment with a colon (:) to enable capturing on the segment.

Panics

Panics if a duplicate route is added.

Retrieve the value associated with the path, together with the captured path segments.