Skip to main content

AddControlRouterExt

Trait AddControlRouterExt 

Source
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§

Source

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.

Source

fn has_control_router<T>(&self) -> bool
where 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".

Implementations on Foreign Types§

Source§

impl AddControlRouterExt for AppContext

Source§

fn add_control_router<T>(&self, router: impl Into<Arc<T>>)
where T: RouterBuilder + 'static,

Source§

fn has_control_router<T>(&self) -> bool
where T: RouterBuilder + 'static,

Implementors§