pub enum LifecycleState {
Installed,
Starting,
Active,
Stopping,
Stopped,
Failed,
}Expand description
Plugin lifecycle states following OSGI-inspired model
State transitions:
Installed → Starting → Active → Stopping → Stopped
↑ │
└────────────────────┘ (restart)
Any state → Failed (on error)Variants§
Installed
Plugin is installed but not yet initialized
Starting
Plugin is starting up (initializing runtime, resources)
Active
Plugin is fully operational and ready to handle requests
Stopping
Plugin is shutting down (cleaning up resources)
Stopped
Plugin has been stopped
Failed
Plugin encountered a fatal error
Implementations§
Source§impl LifecycleState
impl LifecycleState
Sourcepub fn can_transition_to(&self, target: LifecycleState) -> bool
pub fn can_transition_to(&self, target: LifecycleState) -> bool
Check if this state can transition to the target state
Sourcepub fn can_handle_requests(&self) -> bool
pub fn can_handle_requests(&self) -> bool
Check if the plugin can handle requests in this state
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if the plugin is in a terminal state
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get a human-readable description of this state
Trait Implementations§
Source§impl Clone for LifecycleState
impl Clone for LifecycleState
Source§fn clone(&self) -> LifecycleState
fn clone(&self) -> LifecycleState
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 LifecycleState
impl Debug for LifecycleState
Source§impl Default for LifecycleState
impl Default for LifecycleState
Source§fn default() -> LifecycleState
fn default() -> LifecycleState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LifecycleState
impl<'de> Deserialize<'de> for LifecycleState
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
Source§impl Display for LifecycleState
impl Display for LifecycleState
Source§impl PartialEq for LifecycleState
impl PartialEq for LifecycleState
Source§impl Serialize for LifecycleState
impl Serialize for LifecycleState
impl Copy for LifecycleState
impl Eq for LifecycleState
impl StructuralPartialEq for LifecycleState
Auto Trait Implementations§
impl Freeze for LifecycleState
impl RefUnwindSafe for LifecycleState
impl Send for LifecycleState
impl Sync for LifecycleState
impl Unpin for LifecycleState
impl UnwindSafe for LifecycleState
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