Skip to main content

RegistryRpcHandler

Struct RegistryRpcHandler 

Source
pub struct RegistryRpcHandler<R: Reactor> { /* private fields */ }
Expand description

A PluginRpcHandler backed by a locked PluginRegistry.

Each RPC call acquires the mutex for the duration of the operation. For plugin.reload, the handler re-loads from the same path that was recorded at plugin.load time; see RegistryRpcHandler::with_wasm_host.

Implementations§

Source§

impl<R: Reactor> RegistryRpcHandler<R>

Source

pub fn new() -> Self

Create a handler backed by an empty registry.

Source

pub fn with_registry(registry: Arc<Mutex<PluginRegistry<R>>>) -> Self

Attach an existing registry (e.g., pre-loaded with static plugins).

Source

pub fn with_wasm_host(self, host: Arc<dyn WasmHost>) -> Self

Enable WASM plugin loading with the given WasmHost.

Source

pub fn registry(&self) -> Arc<Mutex<PluginRegistry<R>>>

Expose the underlying registry for spawning actors.

Trait Implementations§

Source§

impl<R: Reactor> Default for RegistryRpcHandler<R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<R: Reactor> PluginRpcHandler<R> for RegistryRpcHandler<R>

Source§

fn list_plugins(&self) -> Vec<Value>

List all currently loaded plugins.
Source§

fn load_plugin(&self, path_str: &str) -> Result<Value, String>

Load a plugin from the given file path. Returns plugin info on success.
Source§

fn unload_plugin(&self, name: &str) -> Result<(), String>

Unload a plugin by name.
Source§

fn reload_plugin(&self, name: &str) -> Result<Value, String>

Reload a plugin by name (unload + load from the same path).
Source§

fn spawn_actor( &self, type_name: &str, config: &[u8], ) -> Result<Box<dyn Actor<R>>, String>

Spawn an actor instance for a registered type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> Upcast<T> for U
where T: UpcastFrom<U>,

Source§

fn upcast(self) -> T

Source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

Source§

fn upcast_from(value: Counter<T, B>) -> T

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V