pub struct ModuleCtx {
pub defaults: ModuleDefaults,
pub modules: HashMap<String, Box<dyn Module>>,
pub services: HashMap<String, Box<dyn Any>>,
pub controllers: HashMap<String, Box<dyn Any>>,
pub routers: Vec<MetaRouter>,
pub interceptors: HashMap<String, Box<dyn Any>>,
pub imports: HashMap<String, Vec<String>>,
pub exports: HashMap<String, Vec<String>>,
pub deps: HashMap<String, Vec<String>>,
pub globals: HashMap<String, String>,
}Fields§
§defaults: ModuleDefaults§modules: HashMap<String, Box<dyn Module>>§services: HashMap<String, Box<dyn Any>>§controllers: HashMap<String, Box<dyn Any>>§routers: Vec<MetaRouter>§interceptors: HashMap<String, Box<dyn Any>>§imports: HashMap<String, Vec<String>>§exports: HashMap<String, Vec<String>>§deps: HashMap<String, Vec<String>>§globals: HashMap<String, String>Implementations§
Source§impl ModuleCtx
impl ModuleCtx
pub fn new(defaults: ModuleDefaults) -> Self
pub fn destroy(&self)
pub fn get_controller<R: 'static>( &self, current_module_name: &str, service_name: &str, ) -> Arc<R>
pub fn register_controller( &mut self, current_module_name: &str, service_name: &str, controller: Box<dyn Any>, ) -> bool
pub fn get_interceptor<R: 'static>( &self, current_module_name: &str, service_name: &str, ) -> Arc<R>
pub fn register_interceptor( &mut self, current_module_name: &str, service_name: &str, interceptor: Box<dyn Any>, ) -> bool
pub fn get_service<R: 'static>( &self, current_module_name: &str, service_name: &str, ) -> Arc<R>
pub fn register_service<T: Into<String>>( &mut self, current_module_name: &str, service_name: T, service: Box<dyn Any>, ) -> bool
pub fn register_module( &mut self, current_module_name: &str, module: Box<dyn Module>, ) -> bool
pub fn append_exports<T: Into<String>>( &mut self, current_module_name: &str, service_names: Vec<T>, is_global: bool, ) -> bool
pub fn get_router_full(&self, meta: &InnerMeta) -> AppResult<String>
Auto Trait Implementations§
impl Freeze for ModuleCtx
impl !RefUnwindSafe for ModuleCtx
impl !Send for ModuleCtx
impl !Sync for ModuleCtx
impl Unpin for ModuleCtx
impl !UnwindSafe for ModuleCtx
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