execution_relation_provider.bend
bendvy-ecs-core@0.1.0.3 · 16 lines · 2 definitions
1import Base
2import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout
3import bendvy-ecs-core@0.1.0.3/execution_resource_policy.bend as Policy
4import bendvy-ecs-core@0.1.0.3/execution_relation_context.bend as Context
5import bendvy-ecs-core@0.1.0.3/execution_relation_store.bend as Store
6import bendvy-ecs-core@0.1.0.3/relation_types.bend as T
7
8
9
10def layout(~S:Data,~descriptor:T.Descriptor<S>,key:String) -> Layout.Layout:
11 Layout.LayoutLeaf{Store.Store<S,descriptor>,Store.View<S,descriptor>,Store.project(~S,~descriptor),key,Policy.ProtectedRelation{S,descriptor}}
12
13
14
15def bind(~S:Data,~WR:Type,~resources:Layout.Layout,~same:{WR == Layout.resources(~S,resources) : Type},~route:Layout.Route,~valid:{Layout.grant_valid(~resources,~route) == True{} : Bool},~descriptor:T.Descriptor<S>,~payload:{Layout.payload(resources,route) == Store.Store<S,descriptor> : Type},~view:{Layout.view(resources,route) == Store.View<S,descriptor> : Data},~protected:{Layout.policy(resources,route) == Policy.ProtectedRelation{S,descriptor} : Policy.Policy},context:Context.Context<S,WR,resources,same>) -> Context.Binding<S,WR,resources,same,route,descriptor,payload,view,protected>:
16 Context.Binding{context}