pub struct Router { /* private fields */ }
Expand description
Sapper router struct
Implementations§
Source§impl SapperRouter
impl SapperRouter
pub fn new() -> SapperRouter
Sourcepub fn route<H>(
&mut self,
method: Method,
glob: &'static str,
handler: H,
) -> &mut SapperRouterwhere
H: SapperHandler + 'static,
pub fn route<H>(
&mut self,
method: Method,
glob: &'static str,
handler: H,
) -> &mut SapperRouterwhere
H: SapperHandler + 'static,
basic router method
Sourcepub fn get<H: SapperHandler + 'static>(
&mut self,
glob: &'static str,
handler: H,
) -> &mut SapperRouter
pub fn get<H: SapperHandler + 'static>( &mut self, glob: &'static str, handler: H, ) -> &mut SapperRouter
Like route, but specialized to the Get
method.
Sourcepub fn post<H: SapperHandler + 'static>(
&mut self,
glob: &'static str,
handler: H,
) -> &mut SapperRouter
pub fn post<H: SapperHandler + 'static>( &mut self, glob: &'static str, handler: H, ) -> &mut SapperRouter
Like route, but specialized to the Post
method.
Sourcepub fn put<H: SapperHandler + 'static>(
&mut self,
glob: &'static str,
handler: H,
) -> &mut SapperRouter
pub fn put<H: SapperHandler + 'static>( &mut self, glob: &'static str, handler: H, ) -> &mut SapperRouter
Like route, but specialized to the Put
method.
Sourcepub fn delete<H: SapperHandler + 'static>(
&mut self,
glob: &'static str,
handler: H,
) -> &mut SapperRouter
pub fn delete<H: SapperHandler + 'static>( &mut self, glob: &'static str, handler: H, ) -> &mut SapperRouter
Like route, but specialized to the Delete
method.
Sourcepub fn head<H: SapperHandler + 'static>(
&mut self,
glob: &'static str,
handler: H,
) -> &mut SapperRouter
pub fn head<H: SapperHandler + 'static>( &mut self, glob: &'static str, handler: H, ) -> &mut SapperRouter
Like route, but specialized to the Head
method.
Sourcepub fn patch<H: SapperHandler + 'static>(
&mut self,
glob: &'static str,
handler: H,
) -> &mut SapperRouter
pub fn patch<H: SapperHandler + 'static>( &mut self, glob: &'static str, handler: H, ) -> &mut SapperRouter
Like route, but specialized to the Patch
method.
Sourcepub fn options<H: SapperHandler + 'static>(
&mut self,
glob: &'static str,
handler: H,
) -> &mut SapperRouter
pub fn options<H: SapperHandler + 'static>( &mut self, glob: &'static str, handler: H, ) -> &mut SapperRouter
Like route, but specialized to the Options
method.
pub fn into_router( &self, ) -> &HashMap<Method, Vec<(&'static str, Arc<Box<dyn SapperHandler>>)>>
Auto Trait Implementations§
impl Freeze for SapperRouter
impl !RefUnwindSafe for SapperRouter
impl Send for SapperRouter
impl Sync for SapperRouter
impl Unpin for SapperRouter
impl !UnwindSafe for SapperRouter
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