def describe
bendvy-ecs-core@0.1.0.3 · execution_resource_description.bend:15
import bendvy-ecs-core@0.1.0.3/execution_resource_description.bend as ExecutionResourceDescription
import Base
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as L
import bendvy-ecs-core@0.1.0.3/execution_query_schema.bend as Routes
import bendvy-ecs-core@0.1.0.3/owner_product.bend as Product
15
16def describe(~S:Data,layout:L.Layout,+route:L.Route,resources:L.resources(~S,layout)) -> Description<S,layout>:
17 match layout resources:
18 case L.EmptyLayout{} Unit{}:Description{Unit{},[]}
19 case L.LayoutLeaf{P,V,refresh,+key,_} L.ResourceSlot{owner,+stamp}:Description{L.ResourceSlot{owner,stamp},[Info{route,key,stamp}]}
20 case L.ClassifiedLayoutLeaf{P,V,refresh,+key,kind,_} L.ResourceSlot{owner,+stamp}:Description{L.ResourceSlot{owner,stamp},[Info{route,key,stamp}]}
21 case L.LayoutPair{ll,rr} Product.Owner{left,right}:described_pair(~S,ll,rr,describe(~S,ll,Routes.append_route(route,L.InLeft{L.AtLeaf{}}),left),describe(~S,rr,Routes.append_route(route,L.InRight{L.AtLeaf{}}),right))