pub struct WindowCleanupCascade {
closed_label: String,
drained_pool: Option<bool>,
phase: Phase,
}Expand description
Window-cleanup-cascade saga: fires once per window close, drives the implicit pane-reap + pool-drain-decision flow into an explicit two-step state machine, then completes.
Fields§
§closed_label: StringLabel of the window that closed (the trigger event’s payload).
The saga uses this for label-matching on terminal events:
PanesReaped { label } only advances Step 1 when label
matches; same for PoolDrained/PoolNotLast in Step 2.
Note: under the coordinator’s evict-and-replace policy, only one window-cleanup-cascade saga is ever in flight at a time, so label-matching is technically redundant for correctness. Keep it anyway as cheap defense-in-depth + a clear invariant-statement: “this saga belongs to this window’s cleanup, not whoever’s terminal event happens to land first.”
drained_pool: Option<bool>Whether the host’s drain decision said “yes, that was the
last window” (PoolDrained arm) or “no, more windows
remain” (PoolNotLast arm). None until Step 2 resolves.
Exported for tests.
phase: PhaseImplementations§
Trait Implementations§
Source§impl Saga for WindowCleanupCascade
impl Saga for WindowCleanupCascade
Source§fn input_snapshot(&self) -> Value
fn input_snapshot(&self) -> Value
LSD-2 — record the closing window’s label for --diag sagas.
drained_pool is None at start (only known after Step 2)
so we don’t include it; the durable log captures the inputs
the saga was constructed with, not its evolving state — that
lives in step rows.
Source§fn timeout(&self) -> Duration
fn timeout(&self) -> Duration
CPD-3 — override the default 5s saga timeout. Pane drain (Stage 1 of wrr’s two-stage close cascade) on a workspace with many panes can legitimately take longer than 5s. Per SPEC_CROSS_PROCESS_DISPATCH §3.10.
fn name(&self) -> &'static str
fn start(&mut self, _ctx: &SagaCtx) -> SagaAction
fn on_event(&mut self, event: &Event, ctx: &SagaCtx) -> SagaAction
Auto Trait Implementations§
impl Freeze for WindowCleanupCascade
impl RefUnwindSafe for WindowCleanupCascade
impl Send for WindowCleanupCascade
impl Sync for WindowCleanupCascade
impl Unpin for WindowCleanupCascade
impl UnsafeUnpin for WindowCleanupCascade
impl UnwindSafe for WindowCleanupCascade
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.