Trait Worker Plugin

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub trait WorkerPlugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn plugin_id(&self) -> &str;
    fn register(&self, ctx: &mut PluginContext, config: &Json) -> Result<()>;
​
    // Provided methods
    fn allows_multiple_components(&self) -> bool { ... }
    fn validate(&self, _config: &Json) -> Vec<ConfigDiagnostic> { ... }
}

Trait implemented by Rust out-of-process worker plugins.

Required Methods

plugin_id

fn plugin_id(&self) -> &str

Stable plugin id/kind returned to the Relay host.

register

fn register(&self, ctx: &mut PluginContext, config: &Json) -> Result<()>

Registers callbacks into the worker context.

Provided Methods

allows_multiple_components

fn allows_multiple_components(&self) -> bool

Whether multiple configured components of this plugin kind are allowed.

validate

fn validate(&self, _config: &Json) -> Vec<ConfigDiagnostic>

Validates component config.

Implementors