pub trait ModuleDefinition:
Send
+ Sync
+ 'static {
// Required method
fn register(container: &Container) -> Result<()>;
// Provided methods
fn module_name() -> &'static str { ... }
fn imports() -> Vec<ModuleRef> { ... }
fn is_global() -> bool { ... }
fn exports() -> Vec<&'static str> { ... }
fn controllers() -> Vec<Router<Container>> { ... }
fn route_docs() -> Vec<RouteDocumentation> { ... }
fn on_module_init() -> Vec<LifecycleHook> ⓘ { ... }
fn on_module_destroy() -> Vec<LifecycleHook> ⓘ { ... }
fn on_application_bootstrap() -> Vec<LifecycleHook> ⓘ { ... }
fn on_application_shutdown() -> Vec<LifecycleHook> ⓘ { ... }
}Required Methods§
Provided Methods§
fn module_name() -> &'static str
fn imports() -> Vec<ModuleRef>
fn is_global() -> bool
fn exports() -> Vec<&'static str>
fn controllers() -> Vec<Router<Container>>
fn route_docs() -> Vec<RouteDocumentation>
fn on_module_init() -> Vec<LifecycleHook> ⓘ
fn on_module_destroy() -> Vec<LifecycleHook> ⓘ
fn on_application_bootstrap() -> Vec<LifecycleHook> ⓘ
fn on_application_shutdown() -> Vec<LifecycleHook> ⓘ
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.