pub struct RouteTable { /* private fields */ }Expand description
Route table mapping URL-like paths to handlers.
Implementations§
Source§impl RouteTable
impl RouteTable
pub fn new() -> Self
pub fn add_route(&mut self, pattern: &str, handler: &str, priority: i32)
pub fn dispatch(&mut self, path: &str) -> Option<RouteMatch>
pub fn remove_handler(&mut self, handler: &str) -> usize
pub fn route_count(&self) -> usize
pub fn dispatch_count(&self) -> u64
pub fn has_pattern(&self, pattern: &str) -> bool
pub fn handlers(&self) -> Vec<&str>
pub fn clear(&mut self)
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RouteTable
impl RefUnwindSafe for RouteTable
impl Send for RouteTable
impl Sync for RouteTable
impl Unpin for RouteTable
impl UnsafeUnpin for RouteTable
impl UnwindSafe for RouteTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more