Function nemo_relay_initialize_with_dynamic_plugins

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.

#[unsafe(no_mangle)]pub unsafe extern "C" fn nemo_relay_initialize_with_dynamic_plugins(
    config_json: *const c_char,
    dynamic_plugins_json: *const c_char,
    out_activation: *mut *mut FfiPluginActivation,
    out_report_json: *mut *mut c_char,
) -> NemoRelayStatus

Load and activate dynamic plugins as one owned transaction.

Experimental: this API needs a production consumer before its lifecycle contract is considered stable.

Relay discovers plugins.toml once during this startup call and layers config_json over the discovered configuration. Explicit values take precedence where both sources configure the same setting. Static components from the resolved configuration initialize before components appended by the dynamic plugins. Configuration files are not watched or reloaded. dynamic_plugins_json must contain at least one explicit dynamic-plugin activation specification; use nemo_relay_initialize_plugins for a static-only configuration.

The explicit configuration uses this JSON shape:

1{"version":1,"components":[{"kind":"static.kind","enabled":true,"config":{}}]}

Dynamic plugin specifications use this JSON shape:

1[{"plugin_id":"example","kind":"rust_dynamic","manifest_ref":"/absolute/path/relay-plugin.toml","config":{}}]

kind must be rust_dynamic or worker. environment_ref is optional and applies only to worker plugins. manifest_ref is resolved by the embedding application; this API does not discover installed plugins.

On success, the caller owns out_activation and must clear and free it with nemo_relay_plugin_activation_clear and nemo_relay_plugin_activation_free. out_report_json is a library-owned C string and must be released with nemo_relay_string_free.

Safety

Both input pointers must reference valid, null-terminated C strings. out_activation and out_report_json must be valid, non-null, non-overlapping output pointers.