def read

bendvy-ecs-core@0.1.0.4 · ordinary_query_declaration.bend:132

import bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend as OrdinaryQueryDeclaration
import Base
import bendvy-ecs-core@0.1.0.4/column.bend as Col
import bendvy-ecs-core@0.1.0.4/component.bend as Cmp
import bendvy-ecs-core@0.1.0.4/ordinary_declaration.bend as Identity
import bendvy-ecs-core@0.1.0.4/compose.bend as Q
import bendvy-ecs-core@0.1.0.4/capabilities.bend as Cap

132# Require this component and grant read access to its detached Data view.
133# identity and the storage binding must describe the same schema component.
134# view consumes and returns P, including affine payloads; it must not discard
135# the payload. This declaration neither visits rows nor changes the world.
136# Reads return Found, ComponentAbsent or MissingEntity (including stale/foreign).
137# Example bindings and query(): examples/scheduled-health/registration.bend.
138def read(~S:Data,~P:Type,~Store:Type,~R:Type,~E:Data,~Rest:Type,~V:Data,~Token:Data,~identity:Identity.Declaration<S,P>,~view:P -> P & V,~take:Store -> Rest & Col.Column<S,P>,~put:Rest -> Col.Column<S,P> -> Store) -> Declaration<S,Q.Frame<S,Store,R,E>,Cap.Read<Q.Frame<S,Store,R,E>,V>>:
139  Declaration{Q.read_family(~S,~Store,~R,~E,~Rest,~P,~V,~Token,~take,~put,~view,~Cmp.Family{Identity.key(~S,~P,identity)}),Q.family_match(~S,~Store,~R,~E,~Rest,~P,~V,~Token,~take,~put,~view,~Cmp.Family{Identity.key(~S,~P,identity)},~Q.Required{}),[Clause{Identity.key(~S,~P,identity),Read{}}]}

Uses (14)

Used by (2)