ServiceModule

Trait ServiceModule 

Source
pub trait ServiceModule: Send + Sync
where 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§

Source

fn id(&self) -> ModuleId
where Self: Sized,

Get the unique identifier for this module

Source

fn name(&self) -> &str

Get module name (defaults to type name)

Source

fn description(&self) -> Option<&str>

Get module description

Source

fn version(&self) -> Option<&str>

Get module version

Source

fn configure(&self, services: &mut ServiceBindings)

Configure services for this module using ServiceBindings

Source

fn depends_on(&self) -> Vec<ModuleId>

Get module dependencies (other modules this module depends on)

Source

fn initialize( &self, container: &IocContainer, ) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>>

Initialize module after all dependencies are loaded

Source

fn shutdown( &self, container: &IocContainer, ) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + '_>>

Cleanup module resources

Source

fn is_compatible_with(&self, other_version: &str) -> bool

Check if module is compatible with given version

Source

fn metadata(&self) -> ModuleMetadata
where Self: Sized,

Get module metadata

Implementors§