Function register_plugin

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

pub fn register_plugin(plugin: Arc<dyn Plugin>) -> Result<()>

Registers a plugin by kind.

Registering the same kind twice returns PluginError::RegistrationFailed. Register a plugin kind with the global plugin registry.

Registered plugins can then participate in validation and initialization of PluginConfig documents.

Parameters

  • plugin: Plugin implementation to register.

Returns

A plugin Result that is Ok(()) when the plugin kind was added to the registry.

Errors

Returns an error when a plugin with the same kind is already registered or when the registry lock is poisoned.

Notes

Registration affects future validation and initialization only.