Skip to main content

RuntimeExtension

Trait RuntimeExtension 

pub trait RuntimeExtension:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn name(&self) -> &'static str { ... }
    fn has_explicit_name(&self) -> bool { ... }
    fn on_startup<'life0, 'async_trait>(
        &'life0 self,
        _ctx: ExtensionStartupContext,
    ) -> Pin<Box<dyn Future<Output = Result<ExtensionManifest, ExtensionStartupError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_packet_received<'life0, 'async_trait>(
        &'life0 self,
        _event: RuntimePacketEvent,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_shutdown<'life0, 'async_trait>(
        &'life0 self,
        _ctx: ExtensionShutdownContext,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Separate runtime extension surface from observer plugin hooks.

Provided Methods§

fn name(&self) -> &'static str

Stable extension identifier used in startup logs and diagnostics.

Production extensions should override this with a stable literal identifier. The default value uses Rust type names and can change when refactoring.

fn has_explicit_name(&self) -> bool

Returns true when name() is overridden with a stable identifier.

Hosts may use this for startup validation in hardened environments.

fn on_startup<'life0, 'async_trait>( &'life0 self, _ctx: ExtensionStartupContext, ) -> Pin<Box<dyn Future<Output = Result<ExtensionManifest, ExtensionStartupError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called once during runtime startup to request capabilities, resources, and subscriptions.

fn on_packet_received<'life0, 'async_trait>( &'life0 self, _event: RuntimePacketEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for packet events matching this extension’s immutable startup subscriptions.

fn on_shutdown<'life0, 'async_trait>( &'life0 self, _ctx: ExtensionShutdownContext, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called during runtime shutdown before force-cancel logic runs.

Implementors§