def completed
import bendvy-ecs-core@0.1.0.3/execution_relation_failure_retention.bend as ExecutionRelationFailureRetentionimport Base
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout
import bendvy-ecs-core@0.1.0.3/world.bend as W
import bendvy-ecs-core@0.1.0.3/dependency_application.bend as App
import bendvy-ecs-core@0.1.0.3/dependency_executor.bend as Exec
107# This is an overall Root completion callback, after final deferred policy.
108# It rotates on Finished even with finalApply=false or an unchanged clock, and
109# never advances a Reader, graph cache, resource stamp, sequence or reader ID.
110def completed(~S:Data,~C:Type,~R:Type,~E:Data,~resources:Layout.Layout,~same:{R == Layout.resources(~S,resources) : Type},~Owners:Type,~Guards:Type,~Handler:Type,~Error:Data,~Out:Data,program:Program(~S,~resources),result:Exec.ExecutionResult<App.State<W.World<S,C,R,E>,Owners,Guards,Handler>,String,Error,Out>) -> Exec.ExecutionResult<App.State<W.World<S,C,R,E>,Owners,Guards,Handler>,String,Error,Out>:
111 match result:
112 case Exec.Finished{App.State{world,owners,guards,handler,bindings},events}:Exec.Finished{App.State{retained_world(~S,~C,~R,~E,~resources,~same,program,W.clock(~S,~C,~R,~E,world)),owners,guards,handler,bindings},events}
113 case Exec.Stopped{state,error,events}:Exec.Stopped{state,error,events}
114 case Exec.Invalid{state,reason}:Exec.Invalid{state,reason}
Uses (9)
Used by (0)
No other definition uses this definition.