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§
Provided Methods§
Sourcefn on_init(&self) -> Result<(), String>
fn on_init(&self) -> Result<(), String>
Called once at registry load time. Plugins can initialize resources here. Returns an error to abort plugin loading.
Sourcefn on_shutdown(&self)
fn on_shutdown(&self)
Called when the registry is being torn down (e.g. app shutdown).