def component

bendvy-ecs-core@0.1.0.4 · restore_schema.bend:47

import bendvy-ecs-core@0.1.0.4/restore_schema.bend as RestoreSchema
import Base
import bendvy-ecs-core@0.1.0.4/restore_leaf.bend as Stage
import bendvy-ecs-core@0.1.0.4/snapshot_schema.bend as Save
import bendvy-ecs-core@0.1.0.4/snapshot_leaf.bend as Leaf
import bendvy-ecs-core@0.1.0.4/ordinary_declaration.bend as Identity
import bendvy-ecs-core@0.1.0.4/decode_data.bend as D
import bendvy-ecs-core@0.1.0.4/decode_construction.bend as Constructor
import bendvy-ecs-core@0.1.0.4/bundle_construction.bend as Build

47# Build a persisted component restore leaf from its nominal identity, canonical
48# codec/fallible factory and owned input supply. Stage incoming construction and
49# validate the resulting stored P before World insertion; refusal returns actual
50# inputs through schema release/recovery. No generic Raw-to-arbitrary-Type cast.
51def component(~S:Data,~Context:Type,~I:Type,~P:Type,~Custom:Data,~identity:Identity.Declaration<S,P>,~project:P -> P & D.Raw,~incoming:I -> I & D.Raw,~build:I -> D.Raw -> Build.Construction<I,P,Custom>,~factory:Constructor.FallibleFactory<S,I,P,Custom,identity,project,incoming,build>,~supply:Context -> D.Raw -> Context & I) -> Schema<S,Leaf.Component<S,P,identity,project>,Unit,Stage.State<Context,I,P>,Custom,component_stage(~S,~Context,~I,~P,~Custom,~identity,~project,~incoming,~build,~factory,~supply),Stage.release(~Context,~I,~P),component_clear(~S,~P,~identity,~project),component_insert(~S,~Context,~I,~P,~identity,~project),List<I>,Stage.commit(~Context,~I,~P),Stage.take_recovery(~Context,~I,~P)>:
52  Schema{Save.inventory(~S,~Leaf.Component<S,P,identity,project>,~Unit,~True{},~Leaf.component_fields(~S,~P,~identity,~project),~Save.unit_resource,Save.component(~S,~P,~identity,~project))}

Uses (21)

Used by (0)

No other definition uses this definition.