def export

bendvy-ecs-core@0.1.0.3 · execution_save_recipe.bend:33

import bendvy-ecs-core@0.1.0.3/execution_save_recipe.bend as ExecutionSaveRecipe
import Base
import bendvy-ecs-core@0.1.0.3/ordinary_declaration.bend as C
import bendvy-ecs-core@0.1.0.3/persistence_declaration.bend as Decl
import bendvy-ecs-core@0.1.0.3/decode_data.bend as D
import bendvy-ecs-core@0.1.0.3/decode.bend as Decode

33# The same retained ordinary declaration supplies codec and actual-owner
34# projection. Transient and Plain never evaluate the projection.
35def export(~S:Data,~P:Type,~identity:C.Declaration<S,P>,~project:P -> P & D.Raw,recipe:Leaf<S,P,identity,project>,owner:P) -> Leaf<S,P,identity,project> & (P & Field):
36  match recipe:
37    case Plain{}:(Plain{},(owner,Refused{PlainUnserializable{C.key(~S,~P,identity)}}))
38    case Transient{}:(Transient{},(owner,Omitted{}))
39    case Constructed{+declaration}:projected(~S,~P,~identity,~project,declaration,Decode.decode_owner(~P,~project,Decl.codec(~S,~P,~identity,~project,declaration),owner))

Uses (11)

Used by (0)

No other definition uses this definition.