Skip to main content

RouterBuilderPanelExt

Trait RouterBuilderPanelExt 

Source
pub trait RouterBuilderPanelExt: Sized {
    // Required methods
    fn panel(self, panel: Panel) -> Result<Self>;
    fn panel_handle(&self, prefix: &str) -> Option<PanelHandle>;
}
Expand description

Mounts a Panel on a router the app owns.

let router = Router::builder()
    .discover()
    .app_context(db)
    .panel(Panel::new("admin").resource::<UserResource>())?
    .panel(Panel::new("portal").auth(Auth::custom(Members)).resource::<OrderResource>())?
    .build();

Required Methods§

Source

fn panel(self, panel: Panel) -> Result<Self>

Mounts panel at its prefix with its routes, shell layout, and gating layers.

Source

fn panel_handle(&self, prefix: &str) -> Option<PanelHandle>

The panel mounted at prefix, for code that runs outside a request; None when no panel is mounted there. prefix is spelled as for Panel::new: "admin" and "/admin/" name the same panel.

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 RouterBuilderPanelExt for RouterBuilder

Source§

fn panel(self, panel: Panel) -> Result<Self>

Source§

fn panel_handle(&self, prefix: &str) -> Option<PanelHandle>

Implementors§