def constructed
bendvy-ecs-core@0.1.0.4 · decode_constructed_resource.bend:16
import bendvy-ecs-core@0.1.0.4/decode_constructed_resource.bend as DecodeConstructedResource
import Base
import decode_validated_resource.bend as Resource
import decode_data.bend as D
import bundle_construction.bend as Build
import capabilities.bend as Cap
16def constructed(~I:Type,~R:Type,~H:Type,~request:Cap.OwnedRequest<H,R,Resource.Output<R>>,ctx:H,value:Build.Construction<I,R,D.Error>) -> H & Output<I,R>:
17 match value:
18 case Build.Invalid{owner,error}:(ctx,Refused{owner,error})
19 case Build.Constructed{owner,undo}:returned(~I,~R,~H,undo,Cap.owned_request(~H,~R,~Resource.Output<R>,~request,ctx,owner))