Skip to main content

MemoryPlugin

Trait MemoryPlugin 

Source
pub trait MemoryPlugin: Send + Sync {
    // Required method
    fn name(&self) -> &str;

    // Provided methods
    fn version(&self) -> &str { ... }
    fn on_init(&self) -> Result<(), String> { ... }
    fn on_shutdown(&self) { ... }
}
Expand description

Stable plugin interface. Pro plugins implement this trait and export a registration function via C ABI.

All methods have empty default implementations so plugins can pick which hooks they care about.

Required Methods§

Source

fn name(&self) -> &str

Plugin identifier, e.g. "spool-team-sync". Must be unique.

Provided Methods§

Source

fn version(&self) -> &str

Plugin version string, e.g. "1.0.0".

Source

fn on_init(&self) -> Result<(), String>

Called once at registry load time. Plugins can initialize resources here. Returns an error to abort plugin loading.

Source

fn on_shutdown(&self)

Called when the registry is being torn down (e.g. app shutdown).

Implementors§