[−][src]Struct thruster_core::route_tree::Node
Fields
children: HashMap<String, Node<T>>
value: String
is_wildcard: bool
is_terminal_node: bool
Methods
impl<T: 'static + Context + Send> Node<T>
[src]
pub fn new(value: &str) -> Node<T>
[src]
pub fn new_wildcard(param_name: Option<String>) -> Node<T>
[src]
pub fn add_route(&mut self, route: &str, middleware: MiddlewareChain<T>)
[src]
pub fn add_subtree(&mut self, route: &str, subtree: Node<T>)
[src]
pub fn match_route(
&self,
route: Split<char>
) -> (HashMap<String, String>, bool, &'a MiddlewareChain<T>)
[src]
&self,
route: Split<char>
) -> (HashMap<String, String>, bool, &'a MiddlewareChain<T>)
pub fn match_route_with_params(
&self,
route: Split<char>,
params: HashMap<String, String>
) -> (HashMap<String, String>, bool, &'a MiddlewareChain<T>)
[src]
&self,
route: Split<char>,
params: HashMap<String, String>
) -> (HashMap<String, String>, bool, &'a MiddlewareChain<T>)
pub fn tree_string(&self, indent: &str) -> String
[src]
Used mostly for debugging the route tree Example usage
ⓘThis example is not tested
let mut app = App::create(generate_context); app.get("/plaintext", middleware![plaintext]); println!("app: {}", app._route_parser.route_tree.root_node.tree_string("")); for (route, middleware) in app._route_parser.route_tree.root_node.get_route_list() { println!("{}: {}", route, middleware.len()); }
pub fn get_route_list(
&self
) -> SmallVec<[(String, MiddlewareChain<T>, bool); 8]>
[src]
&self
) -> SmallVec<[(String, MiddlewareChain<T>, bool); 8]>
pub fn push_middleware_to_populated_nodes(
&mut self,
other_node: &Node<T>,
accumulated_middleware: &MiddlewareChain<T>
)
[src]
&mut self,
other_node: &Node<T>,
accumulated_middleware: &MiddlewareChain<T>
)
Pushes middleware down to the leaf nodes, accumulating along the way. This is helpful for propagating generic middleware down the stack
Trait Implementations
impl<T: Context + Send> Clone for Node<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Node<T>
impl<T> Send for Node<T>
impl<T> Sync for Node<T>
impl<T> Unpin for Node<T>
impl<T> !UnwindSafe for Node<T>
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,