Skip to navigation

Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -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 NativePlugin:
Send
+ Sync
+ 'static {
// Required methods
fn plugin_kind(&self) -> &str;
fn register<'a>(
&'a self,
config: &'a Map<String, Json>,
ctx: &'a mut PluginContext<'_>,
) -> PluginFuture<'a, ()>;
// Provided methods
fn allows_multiple_components(&self) -> bool { ... }
fn executor_config(&self) -> Option<NativeExecutorConfig> { ... }
fn executor_config_for_component(
&self,
config: &Map<String, Json>,
) -> Result<Option<NativeExecutorConfig>> { ... }
fn validate(&self, config: &Map<String, Json>) -> Vec<ConfigDiagnostic> { ... }
}

Referenced types: Send, Sync, str, Map, String, Json, PluginContext, PluginFuture, (), bool, Option, NativeExecutorConfig, Vec, ConfigDiagnostic

Explicit name for the native authoring Plugin trait; both names refer to the same trait. Native plugin authoring contract exported as both Plugin and NativePlugin.

Implement this trait for a dynamically loaded Rust plugin and export it with crate::nemo_relay_plugin!. Register callbacks through PluginContext. The host-facing crate::component::Plugin trait is for in-process components and uses the runtime registration context instead of the checked native interface.

Required Methods

plugin_kind

fn plugin_kind(&self) -> &str

Referenced types: str

Return the plugin kind used to select this plugin from component configuration.

register

fn register<'a>(
&'a self,
config: &'a Map<String, Json>,
ctx: &'a mut PluginContext<'_>,
) -> PluginFuture<'a, ()>

Referenced types: Map, String, Json, PluginContext, PluginFuture, ()

Register this component’s callbacks through the host-provided native context.

Provided Methods

allows_multiple_components

fn allows_multiple_components(&self) -> bool

Referenced types: bool

Whether multiple configured components of this plugin may be active; defaults to true.

executor_config

fn executor_config(&self) -> Option<NativeExecutorConfig>

Referenced types: Option, NativeExecutorConfig

Opt into a shared plugin Tokio runtime; inline execution needs no runtime.

executor_config_for_component

fn executor_config_for_component(
&self,
config: &Map<String, Json>,
) -> Result<Option<NativeExecutorConfig>>

Referenced types: Map, String, Json, Option, NativeExecutorConfig

Resolve optional shared Tokio support from plugin defaults and component executor settings.

validate

fn validate(&self, config: &Map<String, Json>) -> Vec<ConfigDiagnostic>

Referenced types: Map, String, Json, Vec, ConfigDiagnostic

Validate component configuration before registration, including native executor settings.

Implementors