Trait RouterService

Source
pub trait RouterService {
    // Required methods
    fn get(&mut self, path: &str, f: Controller) -> &mut Self;
    fn post(&mut self, path: &str, f: Controller) -> &mut Self;
    fn put(&mut self, path: &str, f: Controller) -> &mut Self;
    fn delete(&mut self, path: &str, f: Controller) -> &mut Self;
    fn middleware(
        &mut self,
        path: &str,
        f: Box<dyn Fn(&Request, &Response) + Send + Sync + 'static>,
    ) -> &mut Self;
    fn mount(&mut self, relative_path: &str, router: Router) -> &mut Self;
}

Required Methods§

Source

fn get(&mut self, path: &str, f: Controller) -> &mut Self

Source

fn post(&mut self, path: &str, f: Controller) -> &mut Self

Source

fn put(&mut self, path: &str, f: Controller) -> &mut Self

Source

fn delete(&mut self, path: &str, f: Controller) -> &mut Self

Source

fn middleware( &mut self, path: &str, f: Box<dyn Fn(&Request, &Response) + Send + Sync + 'static>, ) -> &mut Self

Source

fn mount(&mut self, relative_path: &str, router: Router) -> &mut Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§