pub struct PluginHandle { /* private fields */ }Expand description
Handle to an initialized plugin instance
Implementations§
Source§impl PluginHandle
impl PluginHandle
Sourcepub fn new(plugin: Box<dyn Plugin>, config: PluginConfig) -> PluginResult<Self>
pub fn new(plugin: Box<dyn Plugin>, config: PluginConfig) -> PluginResult<Self>
Create a new plugin handle
Sourcepub fn state(&self) -> LifecycleState
pub fn state(&self) -> LifecycleState
Get the current lifecycle state
Sourcepub fn start(&self) -> PluginResult<()>
pub fn start(&self) -> PluginResult<()>
Start the plugin
Sourcepub fn shutdown(&self, timeout_ms: u64) -> PluginResult<()>
pub fn shutdown(&self, timeout_ms: u64) -> PluginResult<()>
Shutdown the plugin
Sourcepub fn set_log_level(&self, level: LogLevel)
pub fn set_log_level(&self, level: LogLevel)
Set the log level
Sourcepub fn mark_failed(&self)
pub fn mark_failed(&self)
Mark the plugin as failed
This is called when a panic is caught at the FFI boundary or when an unrecoverable error occurs. It immediately transitions the plugin to the Failed state.
After calling this method, the plugin will reject all further requests. The host should call plugin_shutdown to clean up resources.
Sourcepub fn rejected_request_count(&self) -> u64
pub fn rejected_request_count(&self) -> u64
Get the count of requests rejected due to concurrency limits
Trait Implementations§
impl Send for PluginHandle
impl Sync for PluginHandle
Auto Trait Implementations§
impl !Freeze for PluginHandle
impl !RefUnwindSafe for PluginHandle
impl Unpin for PluginHandle
impl UnsafeUnpin for PluginHandle
impl !UnwindSafe for PluginHandle
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