def resource_constructed

bendvy-ecs-core@0.1.0.3 · ordinary_schema.bend:93

import bendvy-ecs-core@0.1.0.3/ordinary_schema.bend as OrdinarySchema
import Base
import bendvy-ecs-core@0.1.0.3/decode_data.bend as D
import bendvy-ecs-core@0.1.0.3/persistence_declaration.bend as Persist
import bendvy-ecs-core@0.1.0.3/ordinary_declaration.bend as Component
import bendvy-ecs-core@0.1.0.3/schema_fragments.bend as Fragment

93# Declare a resource with constructed persistence classification from its bound
94# extension. Records the classification and derives the owner type; does not
95# execute codecs, validate input, allocate payloads or export a snapshot.
96# Use the matching persistence declaration and identity when composing a schema.
97def resource_constructed(~S:Data,~P:Type,~identity:Component.Declaration<S,P>,~project:P -> P & D.Raw,extension:Persist.Constructed<S,P,identity,project>) -> Schema<S,Unit,P>:
98  +key=Component.key(~S,~P,identity)
99  Schema{[Fragment.Classified{Fragment.Resource{},key,key,Fragment.Constructed{}}]}

Uses (11)

Used by (0)

No other definition uses this definition.