pub enum ActorPhase {
Running,
Restarting {
generation: u32,
attempt: u32,
},
Stopped {
cause: StopCause,
detail: Option<String>,
},
}Expand description
Actor 生命周期相位 —— 任意时刻可查的运行状态
(ActorRef::phase)。
与一次性的 ActorSignal::Terminated 通知互补:通知只描述“刚刚终止“
这一时刻事件,相位是持续可查的状态 —— 通道保留末值,Actor 停止后
再查询/订阅照样能读到最终死因与 panic 详情(无需额外墓碑表)。
Variants§
Running
世代正在运行(含世代启动前的初始态)。
Restarting
监督重启空窗:上一世代已退出,新世代尚未启动。
由 Transient 退避等待期间发布,供上层观测/展示重启过程
(如地面站 UI 的“链路重连中“)。
Fields
§
generation: u32即将启动的世代号(与 ActorContext::generation 同源)。
§
attempt: u32本次重启计数(与 ActorContext::restarts 同源)。
Stopped
已停止:停止请求已落值(detail 为 None),或已最终退出
(cause 为真实死因,panic 详情随 detail)。
一旦进入不可逆 —— 运行期状态发布(Running / Restarting)不会
覆盖它;唯一例外是最终退出:finalize 以真实死因覆盖“停止请求“占位。
Implementations§
Trait Implementations§
Source§impl Clone for ActorPhase
impl Clone for ActorPhase
Source§impl Debug for ActorPhase
impl Debug for ActorPhase
impl Eq for ActorPhase
Source§impl PartialEq for ActorPhase
impl PartialEq for ActorPhase
impl StructuralPartialEq for ActorPhase
Auto Trait Implementations§
impl Forget for ActorPhase
impl Freeze for ActorPhase
impl Move for ActorPhase
impl RefUnwindSafe for ActorPhase
impl Send for ActorPhase
impl Sync for ActorPhase
impl Unpin for ActorPhase
impl UnsafeUnpin for ActorPhase
impl UnwindSafe for ActorPhase
Blanket Implementations§
impl<T> ActorMsg for Twhere
T: Send + 'static,
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