RouteInstance

Trait RouteInstance 

Source
pub trait RouteInstance {
    // Required method
    fn router_mut(&mut self) -> &mut Router<RouteHandler>;

    // Provided methods
    fn mount(&self) -> &str { ... }
    fn add_route(
        &mut self,
        path: &str,
        method: Option<Method>,
        handler: RouteHandler,
    ) { ... }
}

Required Methods§

Source

fn router_mut(&mut self) -> &mut Router<RouteHandler>

Provided Methods§

Source

fn mount(&self) -> &str

Mounts the route on a path, defaults to “/”

Source

fn add_route( &mut self, path: &str, method: Option<Method>, handler: RouteHandler, )

Adds a route to the platform data.

§Arguments
  • path - The path of the route.
  • method - The HTTP method of the route.
  • handler - The handler function for the route.

Implementors§