pub trait ServiceModule: Send + Syncwhere
Self: 'static,{
// Provided methods
fn id(&self) -> ModuleId
where Self: Sized { ... }
fn name(&self) -> &str { ... }
fn description(&self) -> Option<&str> { ... }
fn version(&self) -> Option<&str> { ... }
fn configure(&self, services: &mut ServiceBindings) { ... }
fn depends_on(&self) -> Vec<ModuleId> { ... }
fn initialize(
&self,
container: &IocContainer,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>> { ... }
fn shutdown(
&self,
container: &IocContainer,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>> { ... }
fn is_compatible_with(&self, other_version: &str) -> bool { ... }
fn metadata(&self) -> ModuleMetadata
where Self: Sized { ... }
}
Expand description
Service module trait for organizing related services
Provided Methods§
Sourcefn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Get module description
Sourcefn configure(&self, services: &mut ServiceBindings)
fn configure(&self, services: &mut ServiceBindings)
Configure services for this module using ServiceBindings
Sourcefn depends_on(&self) -> Vec<ModuleId>
fn depends_on(&self) -> Vec<ModuleId>
Get module dependencies (other modules this module depends on)
Sourcefn initialize(
&self,
container: &IocContainer,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>>
fn initialize( &self, container: &IocContainer, ) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>>
Initialize module after all dependencies are loaded
Sourcefn shutdown(
&self,
container: &IocContainer,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>>
fn shutdown( &self, container: &IocContainer, ) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>>
Cleanup module resources
Sourcefn is_compatible_with(&self, other_version: &str) -> bool
fn is_compatible_with(&self, other_version: &str) -> bool
Check if module is compatible with given version
Sourcefn metadata(&self) -> ModuleMetadatawhere
Self: Sized,
fn metadata(&self) -> ModuleMetadatawhere
Self: Sized,
Get module metadata