Skip to main content

SystemCapability

Trait SystemCapability 

Source
pub trait SystemCapability: Send + Sync {
    // Provided methods
    fn pre_init(&self, _sys: &SystemContext) -> Result<()> { ... }
    fn post_init<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _sys: &'life1 SystemContext,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

System capability: receives runtime internals before init.

This trait is internal to modkit and only used by modules with the “system” capability. Normal user modules don’t implement this.

Provided Methods§

Source

fn pre_init(&self, _sys: &SystemContext) -> Result<()>

Optional pre-init hook for system modules.

This runs BEFORE init() has completed for ALL modules, and only for system modules.

Default implementation is a no-op so most modules don’t need to implement it.

§Errors

Returns an error if system wiring fails.

Source

fn post_init<'life0, 'life1, 'async_trait>( &'life0 self, _sys: &'life1 SystemContext, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Optional post-init hook for system modules.

This runs AFTER init() has completed for ALL modules, and only for system modules.

Default implementation is a no-op so most modules don’t need to implement it.

Implementors§