pub struct ModuleRef {
pub name: &'static str,
pub register: Arc<dyn Fn(&Container) -> Result<()> + Send + Sync>,
pub controllers: Arc<dyn Fn() -> Vec<Router<Container>> + Send + Sync>,
pub route_docs: Arc<dyn Fn() -> Vec<RouteDocumentation> + Send + Sync>,
pub on_module_init: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>,
pub on_module_destroy: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>,
pub on_application_bootstrap: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>,
pub on_application_shutdown: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>,
pub imports: Arc<dyn Fn() -> Vec<ModuleRef> + Send + Sync>,
pub exports: Arc<dyn Fn() -> Vec<&'static str> + Send + Sync>,
pub is_global: Arc<dyn Fn() -> bool + Send + Sync>,
}Fields§
§name: &'static str§register: Arc<dyn Fn(&Container) -> Result<()> + Send + Sync>§controllers: Arc<dyn Fn() -> Vec<Router<Container>> + Send + Sync>§route_docs: Arc<dyn Fn() -> Vec<RouteDocumentation> + Send + Sync>§on_module_init: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>§on_module_destroy: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>§on_application_bootstrap: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>§on_application_shutdown: Arc<dyn Fn() -> Vec<LifecycleHook> + Send + Sync>§imports: Arc<dyn Fn() -> Vec<ModuleRef> + Send + Sync>§exports: Arc<dyn Fn() -> Vec<&'static str> + Send + Sync>§is_global: Arc<dyn Fn() -> bool + Send + Sync>Implementations§
Source§impl ModuleRef
impl ModuleRef
pub fn of<M: ModuleDefinition>() -> Self
pub fn dynamic( name: &'static str, register: impl Fn(&Container) -> Result<()> + Send + Sync + 'static, ) -> Self
pub fn builder(name: &'static str) -> DynamicModuleBuilder
pub fn with_imports( self, imports: impl Fn() -> Vec<ModuleRef> + Send + Sync + 'static, ) -> Self
pub fn with_exports( self, exports: impl Fn() -> Vec<&'static str> + Send + Sync + 'static, ) -> Self
pub fn with_controllers( self, controllers: impl Fn() -> Vec<Router<Container>> + Send + Sync + 'static, ) -> Self
pub fn with_route_docs( self, route_docs: impl Fn() -> Vec<RouteDocumentation> + Send + Sync + 'static, ) -> Self
pub fn with_module_init_hooks( self, hooks: impl Fn() -> Vec<LifecycleHook> + Send + Sync + 'static, ) -> Self
pub fn with_module_destroy_hooks( self, hooks: impl Fn() -> Vec<LifecycleHook> + Send + Sync + 'static, ) -> Self
pub fn with_application_bootstrap_hooks( self, hooks: impl Fn() -> Vec<LifecycleHook> + Send + Sync + 'static, ) -> Self
pub fn with_application_shutdown_hooks( self, hooks: impl Fn() -> Vec<LifecycleHook> + Send + Sync + 'static, ) -> Self
pub fn as_global(self) -> Self
pub fn with_is_global(self, is_global: bool) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModuleRef
impl !RefUnwindSafe for ModuleRef
impl Send for ModuleRef
impl Sync for ModuleRef
impl Unpin for ModuleRef
impl UnsafeUnpin for ModuleRef
impl !UnwindSafe for ModuleRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more