[−][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 to_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.to_string("")); for (route, middleware) in app._route_parser.route_tree.root_node.enumerate() { println!("{}: {}", route, middleware.len()); }
pub fn enumerate(&self) -> SmallVec<[(String, MiddlewareChain<T>); 8]>
[src]
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
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,