Skip to main content

ResourceFeature

Trait ResourceFeature 

Source
pub trait ResourceFeature:
    Send
    + Sync
    + 'static {
    // Required method
    fn mount(&self, ctx: &RouteCtx, resource: &ResourceInfo) -> Router;
}
Expand description

A feature a module mounts under every resource whose descriptor declares its key: the routes behind import: true, say.

The admin owns the key and the button; the module owns the routes. A descriptor declaring a key no module serves aborts boot naming it, so the admin never depends on the module.

Required Methods§

Source

fn mount(&self, ctx: &RouteCtx, resource: &ResourceInfo) -> Router

The routes, relative to {resource}/{key}, which is ctx.base_path().

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§