pub struct PluginContext {
pub config: PluginConfig,
/* private fields */
}Expand description
Context provided to plugin operations
Fields§
§config: PluginConfigPlugin configuration
Implementations§
Source§impl PluginContext
impl PluginContext
Sourcepub fn new(config: PluginConfig) -> Self
pub fn new(config: PluginConfig) -> Self
Create a new plugin context
Sourcepub fn state(&self) -> LifecycleState
pub fn state(&self) -> LifecycleState
Get current lifecycle state
Sourcepub fn set_state(&self, state: LifecycleState)
pub fn set_state(&self, state: LifecycleState)
Set lifecycle state directly (bypassing transition validation)
Use this for error recovery scenarios where normal transitions don’t apply.
Sourcepub fn transition_to(&self, target: LifecycleState) -> PluginResult<()>
pub fn transition_to(&self, target: LifecycleState) -> PluginResult<()>
Attempt to transition to a new state
Auto Trait Implementations§
impl !Freeze for PluginContext
impl RefUnwindSafe for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
impl Unpin for PluginContext
impl UnwindSafe for PluginContext
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