[][src]Trait tide_fluent_routes::routebuilder::RouteBuilder

pub trait RouteBuilder<State: Clone + Send + Sync + 'static>: Sized {
    fn at<R: FnOnce(Self) -> Self>(self, path: &str, routes: R) -> Self;
fn with<M: Middleware<State>, R: FnOnce(Self) -> Self>(
        self,
        middleware: M,
        routes: R
    ) -> Self;
fn method(self, method: Method, endpoint: impl Endpoint<State>) -> Self;
fn all(self, endpoint: impl Endpoint<State>) -> Self;
fn name(self, name: &str) -> Self; }

A routebuilder can be used to define routes by adding path segments, middelwares and endpoints to a route tree

Required methods

fn at<R: FnOnce(Self) -> Self>(self, path: &str, routes: R) -> Self[src]

Add a path segment with a set of sub-routes

fn with<M: Middleware<State>, R: FnOnce(Self) -> Self>(
    self,
    middleware: M,
    routes: R
) -> Self
[src]

Add middleware with a set of sub-routes

fn method(self, method: Method, endpoint: impl Endpoint<State>) -> Self[src]

Add an endpoint for an http method

fn all(self, endpoint: impl Endpoint<State>) -> Self[src]

Add a catchall endpoint

fn name(self, name: &str) -> Self[src]

Make this a named route

Loading content...

Implementors

impl<State: Clone + Send + Sync + 'static> RouteBuilder<State> for RouteSegment<State>[src]

Loading content...