def resource

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

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

53# Build a persisted resource restore leaf using the same constructed declaration
54# and factory contract. Omitted resources remain owned by World; a staged value
55# replaces through schema insertion only after complete preparation/admission.
56def resource(~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,Unit,Leaf.Resource<S,P,identity,project>,Stage.State<Context,I,P>,Custom,resource_stage(~S,~Context,~I,~P,~Custom,~identity,~project,~incoming,~build,~factory,~supply),Stage.release(~Context,~I,~P),resource_clear(~S),resource_insert(~S,~Context,~I,~P,~identity,~project),List<I>,Stage.commit(~Context,~I,~P),Stage.take_recovery(~Context,~I,~P)>:
57  Schema{Save.inventory(~S,~Unit,~Leaf.Resource<S,P,identity,project>,~True{},~Save.unit_component,~Leaf.resource_fields(~S,~P,~identity,~project),Save.resource(~S,~P,~identity,~project))}

Uses (21)

Used by (0)

No other definition uses this definition.