pub trait AddControlRouterExt {
// Required methods
fn add_control_router<T>(&self, router: impl Into<Arc<T>>)
where T: RouterBuilder + 'static;
fn has_control_router<T>(&self) -> bool
where T: RouterBuilder + 'static;
}Expand description
Registers concrete RouterBuilder instances on the control HTTP server.
The control-server counterpart of AddRouterExt.
Lives on AppContext, so routers can be registered while configuring the
AppBuilder or from within a plugin’s build. A router is identified by
its type. Registration does not require ControlServerPlugin; without it
the router is simply never served.
Required Methods§
Sourcefn add_control_router<T>(&self, router: impl Into<Arc<T>>)where
T: RouterBuilder + 'static,
fn add_control_router<T>(&self, router: impl Into<Arc<T>>)where
T: RouterBuilder + 'static,
Registers router on the control HTTP server.
§Panics
Panics if a router of type T is already registered on the control
server. Guard with
has_control_router when the
same type may be registered more than once.
Sourcefn has_control_router<T>(&self) -> boolwhere
T: RouterBuilder + 'static,
fn has_control_router<T>(&self) -> boolwhere
T: RouterBuilder + 'static,
Returns whether a router of type T is registered on the control server.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".