diff --git a/src/lib.rs b/src/lib.rs index f3941cc..f3ab375 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,7 +142,7 @@ use alloc::{ string::{String, ToString}, vec::Vec, }; -use core::str::from_utf8; +use core::{slice::Iter, str::from_utf8}; use smallvec::SmallVec; mod node; @@ -258,6 +258,10 @@ impl PathTree { from_utf8(&bytes).map(ToString::to_string).ok() }) } + + pub fn iter(&self) -> Iter<'_, (T, Vec)> { + self.routes.iter() + } } /// Matched route path infomation.