Skip to main content

ApplicationModule

Trait ApplicationModule 

Source
pub trait ApplicationModule:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn id(&self) -> &'static str;
    fn register(&self, registry: &mut ModuleRegistry) -> Result<()>;
}
Expand description

A cohesive feature area — Inbox, Projects, Traffic, Health.

Modules are compile-time components. Origin has no dynamic plugin loading: a module is code that was linked in, which keeps the dependency graph honest and the binary auditable.

Required Methods§

Source

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

Stable identifier, used in logs and in the app manifest.

Source

fn register(&self, registry: &mut ModuleRegistry) -> Result<()>

Wire the module up: read settings, provide services, subscribe to events.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§