Skip to main content

SaolaModule

Trait SaolaModule 

Source
pub trait SaolaModule:
    Send
    + Sync
    + 'static {
    // Required method
    fn name(&self) -> &'static str;

    // Provided methods
    fn context(&self) -> &'static str { ... }
    fn priority(&self) -> i32 { ... }
    fn register(&self, _app: &mut Registrar) { ... }
    fn routes(&self, _ctx: &mut ContextRoutes<'_>) { ... }
    fn web_routes(&self, _route: &mut Router) { ... }
    fn api_routes(&self, _route: &mut Router) { ... }
}
Expand description

Modular registration unit mirroring Saola’s ModuleServiceProvider / ModuleService.

Required Methods§

Source

fn name(&self) -> &'static str

Provided Methods§

Source

fn context(&self) -> &'static str

Source

fn priority(&self) -> i32

Source

fn register(&self, _app: &mut Registrar)

Source

fn routes(&self, _ctx: &mut ContextRoutes<'_>)

Registers routes into any declared Saola context (web, admin, api, subdomains…).

Source

fn web_routes(&self, _route: &mut Router)

Source

fn api_routes(&self, _route: &mut Router)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§