pub struct HttpRouter<T> { /* private fields */ }
Implementations§
Source§impl<T> HttpRouter<T>
impl<T> HttpRouter<T>
pub fn new() -> Self
pub fn find<'p, 's: 'p>( &'s self, method: &Method, path: &'p str, ) -> Option<(&'s T, Captures<'p>)>
pub fn find_mut<'p, 's: 'p>( &'s mut self, method: &Method, path: &'p str, ) -> Option<(&'s mut T, Captures<'p>)>
pub fn insert(&mut self, method: Method, pattern: &str, data: T) -> &mut Self
pub fn try_insert( &mut self, method: Method, pattern: &str, data: T, ) -> Result<&mut Self, RouterError>
pub fn nest( &mut self, prefix: &str, f: impl FnOnce(&mut HttpRouter<T>), ) -> &mut Self
pub fn try_nest( &mut self, prefix: &str, f: impl FnOnce(&mut HttpRouter<T>), ) -> Result<&mut Self, RouterError>
pub fn insert_router(&mut self, prefix: &str, router: HttpRouter<T>)
pub fn try_insert_router( &mut self, prefix: &str, router: HttpRouter<T>, ) -> Result<&mut Self, RouterError>
Source§impl HttpRouter<Box<dyn Handler + Send + Sync>>
impl HttpRouter<Box<dyn Handler + Send + Sync>>
pub fn get( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn post( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn put( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn delete( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn head( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn options( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn connect( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn patch( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
pub fn trace( &mut self, path: &str, h: impl Handler + Send + Sync + 'static, ) -> &mut Self
Trait Implementations§
Source§impl<T: Debug> Debug for HttpRouter<T>
impl<T: Debug> Debug for HttpRouter<T>
Source§impl<T: Default> Default for HttpRouter<T>
impl<T: Default> Default for HttpRouter<T>
Source§fn default() -> HttpRouter<T>
fn default() -> HttpRouter<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for HttpRouter<T>
impl<T> RefUnwindSafe for HttpRouter<T>where
T: RefUnwindSafe,
impl<T> Send for HttpRouter<T>where
T: Send,
impl<T> Sync for HttpRouter<T>where
T: Sync,
impl<T> Unpin for HttpRouter<T>where
T: Unpin,
impl<T> UnwindSafe for HttpRouter<T>where
T: UnwindSafe,
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