Skip to main content

AddControlRouterServiceExt

Trait AddControlRouterServiceExt 

Source
pub trait AddControlRouterServiceExt {
    // Required methods
    fn add_control_router_service<T>(&mut self) -> &mut Self
       where T: Service<Handle = Arc<T>> + RouterBuilder + 'static;
    fn has_control_router_service<T>(&self) -> bool
       where T: Service<Handle = Arc<T>> + RouterBuilder + 'static;
}
Expand description

Registers routers resolved from the dependency-injection container on the control HTTP server.

The control-server counterpart of AddRouterServiceExt: the router type T is a Service, built by the container and registered as a RouterBuilder. The service is added automatically if it is not already present.

Required Methods§

Source

fn add_control_router_service<T>(&mut self) -> &mut Self
where T: Service<Handle = Arc<T>> + RouterBuilder + 'static,

Registers the Service T and serves its routes on the control server.

§Panics

Panics if T is already registered as a control router service. Building the App additionally panics if T is registered both as a service router and as an instance via AddControlRouterExt::add_control_router.

Source

fn has_control_router_service<T>(&self) -> bool
where T: Service<Handle = Arc<T>> + RouterBuilder + 'static,

Returns whether T is registered as a control router service.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AddControlRouterServiceExt for AppBuilder

Source§

fn add_control_router_service<T>(&mut self) -> &mut Self
where T: Service<Handle = Arc<T>> + RouterBuilder + 'static,

Source§

fn has_control_router_service<T>(&self) -> bool
where T: Service<Handle = Arc<T>> + RouterBuilder + 'static,

Implementors§