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§
Sourcefn add_control_router_service<T>(&mut self) -> &mut Self
fn add_control_router_service<T>(&mut self) -> &mut Self
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.
Sourcefn has_control_router_service<T>(&self) -> bool
fn has_control_router_service<T>(&self) -> bool
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".