pub struct PluginInstance {
pub metadata: PluginMetadata,
pub state: PluginState,
}Expand description
A registered plugin instance combining metadata and runtime state.
Fields§
§metadata: PluginMetadataDescriptive metadata for this plugin.
state: PluginStateCurrent lifecycle state.
Implementations§
Source§impl PluginInstance
impl PluginInstance
Sourcepub fn new(metadata: PluginMetadata) -> Self
pub fn new(metadata: PluginMetadata) -> Self
Create a new plugin instance in the Unloaded state.
Sourcepub fn transition_to(&mut self, new_state: PluginState) -> KernelResult<()>
pub fn transition_to(&mut self, new_state: PluginState) -> KernelResult<()>
Attempt to transition to the given state.
Valid transitions:
- Unloaded -> Loaded
- Loaded -> Initialized
- Initialized -> Active
- Any state -> Error
Returns an error for invalid transitions.
Trait Implementations§
Source§impl Clone for PluginInstance
impl Clone for PluginInstance
Source§fn clone(&self) -> PluginInstance
fn clone(&self) -> PluginInstance
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PluginInstance
impl RefUnwindSafe for PluginInstance
impl Send for PluginInstance
impl Sync for PluginInstance
impl Unpin for PluginInstance
impl UnwindSafe for PluginInstance
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)