pub struct ProcessRuntime { /* private fields */ }Expand description
Persistent, independently supervised worker process for each loaded plugin.
The executable must implement the hidden __plugin-worker LANGUAGE entrypoint.
Implementations§
Source§impl ProcessRuntime
impl ProcessRuntime
Sourcepub fn new(executable: PathBuf) -> PluginResult<Self>
pub fn new(executable: PathBuf) -> PluginResult<Self>
Run Lua plugins in workers launched from executable, which must
support the private worker protocol.
Trait Implementations§
Source§impl Drop for ProcessRuntime
impl Drop for ProcessRuntime
Source§impl PluginRuntime for ProcessRuntime
impl PluginRuntime for ProcessRuntime
Source§fn file_extensions(&self) -> &'static [&'static str]
fn file_extensions(&self) -> &'static [&'static str]
Get the file extensions this runtime handles (e.g., [“.lua”]).
Source§fn init(&mut self, config: &PluginConfig) -> PluginResult<()>
fn init(&mut self, config: &PluginConfig) -> PluginResult<()>
Initialize the runtime with configuration.
Source§fn load_plugin(&mut self, id: &str, source: &Path) -> PluginResult<PluginHandle>
fn load_plugin(&mut self, id: &str, source: &Path) -> PluginResult<PluginHandle>
Load a plugin from a file path. Read more
Source§fn unload_plugin(&mut self, handle: PluginHandle) -> PluginResult<()>
fn unload_plugin(&mut self, handle: PluginHandle) -> PluginResult<()>
Unload a previously loaded plugin.
Source§fn get_metadata(&self, handle: PluginHandle) -> Option<&PluginMetadata>
fn get_metadata(&self, handle: PluginHandle) -> Option<&PluginMetadata>
Get metadata about a loaded plugin.
Source§fn has_hook(&self, handle: PluginHandle, name: &str) -> bool
fn has_hook(&self, handle: PluginHandle, name: &str) -> bool
Check if a plugin implements a specific hook.
Source§fn call_hook_sync(
&self,
handle: PluginHandle,
hook: &Hook,
ctx: &HookContext,
) -> PluginResult<HookResult>
fn call_hook_sync( &self, handle: PluginHandle, hook: &Hook, ctx: &HookContext, ) -> PluginResult<HookResult>
Call a hook on a plugin synchronously. Read more
Source§fn call_hook_async<'a>(
&'a self,
handle: PluginHandle,
hook: &'a Hook,
ctx: &'a HookContext,
) -> Pin<Box<dyn Future<Output = PluginResult<HookResult>> + Send + 'a>>
fn call_hook_async<'a>( &'a self, handle: PluginHandle, hook: &'a Hook, ctx: &'a HookContext, ) -> Pin<Box<dyn Future<Output = PluginResult<HookResult>> + Send + 'a>>
Call a hook on a plugin asynchronously. Read more
Source§fn call_method<'a>(
&'a self,
handle: PluginHandle,
method: &'a str,
args: Vec<Value>,
) -> Pin<Box<dyn Future<Output = PluginResult<Value>> + Send + 'a>>
fn call_method<'a>( &'a self, handle: PluginHandle, method: &'a str, args: Vec<Value>, ) -> Pin<Box<dyn Future<Output = PluginResult<Value>> + Send + 'a>>
Call an arbitrary method on a plugin.
Source§fn create_isolated_context(
&self,
sandbox: &SandboxConfig,
) -> PluginResult<Box<dyn IsolatedContext>>
fn create_isolated_context( &self, sandbox: &SandboxConfig, ) -> PluginResult<Box<dyn IsolatedContext>>
Create an isolated context for running async plugin code. Read more
Source§fn loaded_plugins(&self) -> Vec<PluginHandle>
fn loaded_plugins(&self) -> Vec<PluginHandle>
Get the list of loaded plugin handles.
Source§fn shutdown(&mut self) -> PluginResult<()>
fn shutdown(&mut self) -> PluginResult<()>
Shutdown the runtime and cleanup resources.
Auto Trait Implementations§
impl Freeze for ProcessRuntime
impl RefUnwindSafe for ProcessRuntime
impl Send for ProcessRuntime
impl Sync for ProcessRuntime
impl Unpin for ProcessRuntime
impl UnsafeUnpin for ProcessRuntime
impl UnwindSafe for ProcessRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more