pub struct PluginLifecycle {
pub name: String,
pub policy: PluginPolicy,
pub state: PluginState,
pub capabilities: Vec<Capability>,
pub last_used: Option<DateTime<Utc>>,
pub memory_mb: f64,
pub initialized: bool,
pub error: Option<String>,
}Expand description
Plugin lifecycle metadata
Fields§
§name: StringPlugin name
policy: PluginPolicyLifecycle policy
state: PluginStateCurrent state
capabilities: Vec<Capability>Capabilities this plugin provides
last_used: Option<DateTime<Utc>>Last time plugin was used
memory_mb: f64Memory usage estimate in MB
initialized: boolWhether plugin has been initialized
error: Option<String>Error message if in error state
Implementations§
Source§impl PluginLifecycle
impl PluginLifecycle
Sourcepub fn always_on(name: &str, capabilities: Vec<Capability>) -> Self
pub fn always_on(name: &str, capabilities: Vec<Capability>) -> Self
Create new lifecycle for an always-on plugin
Sourcepub fn on_demand(
name: &str,
capabilities: Vec<Capability>,
memory_mb: f64,
) -> Self
pub fn on_demand( name: &str, capabilities: Vec<Capability>, memory_mb: f64, ) -> Self
Create new lifecycle for an on-demand plugin
Sourcepub fn can_unload(&self) -> bool
pub fn can_unload(&self) -> bool
Check if plugin can be unloaded
Sourcepub fn can_suspend(&self) -> bool
pub fn can_suspend(&self) -> bool
Check if plugin can be suspended
Trait Implementations§
Source§impl Clone for PluginLifecycle
impl Clone for PluginLifecycle
Source§fn clone(&self) -> PluginLifecycle
fn clone(&self) -> PluginLifecycle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginLifecycle
impl Debug for PluginLifecycle
Source§impl<'de> Deserialize<'de> for PluginLifecycle
impl<'de> Deserialize<'de> for PluginLifecycle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PluginLifecycle
impl RefUnwindSafe for PluginLifecycle
impl Send for PluginLifecycle
impl Sync for PluginLifecycle
impl Unpin for PluginLifecycle
impl UnwindSafe for PluginLifecycle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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