def run

bendvy-ecs-core@0.1.0.4 · local.bend:99

import bendvy-ecs-core@0.1.0.4/local.bend as Local
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W

99# Validate namespace and live registration metadata before invoking runner.
100# Refused returns original Args/instance/World. Completed retains the Local
101# returned by the runner even on error; World rollback is the runner's job.
102# This primitive has no query lifecycle cursor of its own.
103def run(~S: Data,~C: Type,~R: Type,~E: Data,~L: Type,~Args: Type,~Error: Data,~Out: Type,~runner: W.World<S,C,R,E> -> L -> Args -> Outcome<W.World<S,C,R,E>,L,Error,Out>,instance: Instance<S,C,R,E,L,Args,Error,Out,runner>,world: W.World<S,C,R,E>,args: Args) -> Run<S,C,R,E,L,Args,Error,Out,runner>:
104  match instance world:
105    case Instance{+namespace,+id,+name,+access,local} W.World{+actual,allocator,store,resource,events,pending,+registrations,nextSystemId,clock}:
106      checked(~S,~C,~R,~E,~L,~Args,~Error,~Out,~runner,Bool.and(U32.is_eq(namespace,actual),W.registration_list_matches(registrations,id,name,access)),Instance{namespace,id,name,access,local},W.World{actual,allocator,store,resource,events,pending,registrations,nextSystemId,clock},args)

Uses (8)

Used by (2)