Type Alias xitca_web::NestApp

source ·
pub type NestApp<C> = App<AppRouter<BoxedSyncServiceObject<(), Box<dyn for<'r> ServiceObject<WebContext<'r, C, RequestBody>, Response = WebResponse, Error = RouterError<Error<C>>>>, Infallible>>>;
Expand description

type alias for concrete type of nested App.

Example

// a function return an App instance.
fn app() -> NestApp<usize> {
    App::new().at("/index", handler_service(|_: &WebContext<'_, usize>| async { "" }))
}

// nest app would be registered with /v2 as prefix therefore "/v2/index" become accessible.
App::new().at("/v2", app()).with_state(996usize);

Aliased Type§

struct NestApp<C> { /* private fields */ }