def extend_selection

bendvy-ecs-core@0.1.0.3 · execution_command_permission.bend:45

import bendvy-ecs-core@0.1.0.3/execution_command_permission.bend as ExecutionCommandPermission
import Base
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout
import bendvy-ecs-core@0.1.0.3/execution_resource_policy.bend as Policy
import bendvy-ecs-core@0.1.0.3/execution_relation_store.bend as RelationStore
import bendvy-ecs-core@0.1.0.3/relation_types.bend as Relation
import bendvy-ecs-core@0.1.0.3/execution_relation_resource_dispatch.bend as Dispatch
import bendvy-ecs-core@0.1.0.3/execution_relation_resource_snapshot.bend as Snapshot

45def extend_selection(~S:Data,~resources:Layout.Layout,~route:Layout.Route,~valid:{Layout.grant_valid(~resources,~route) == True{} : Bool},~descriptor:Relation.Descriptor<S>,~payload:{Layout.payload(resources,route) == RelationStore.Store<S,descriptor> : Type},~view:{Layout.view(resources,route) == RelationStore.View<S,descriptor> : Data},~protected:{Layout.policy(resources,route) == Policy.ProtectedRelation{S,descriptor} : Policy.Policy},selection:Selection<S,resources>) -> Selection<S,resources>:
46  match selection:
47    case Selection{program,snapshot,scopes,cleanup}:Selection{Dispatch.extend(~S,~resources,~route,~valid,~descriptor,~payload,~view,~protected,program),Snapshot.extend(~S,~resources,~route,~descriptor,~payload,~view,~protected,snapshot),scopes,cleanup}

Uses (14)

Used by (2)