def constructed

bendvy-ecs-core@0.1.0.4 · decode_fallible_constructed_resource.bend:17

import bendvy-ecs-core@0.1.0.4/decode_fallible_constructed_resource.bend as DecodeFallibleConstructedResource
import Base
import decode_construction.bend as Constructor
import decode_validated_resource.bend as Resource
import bundle_construction.bend as Build
import capabilities.bend as Cap

17def constructed(~I:Type,~R:Type,~Custom:Data,~H:Type,~request:Cap.OwnedRequest<H,R,Resource.Output<R>>,ctx:H,value:Build.Construction<I,R,Constructor.Error<Custom>>) -> H & Output<I,R,Custom>:
18  match value:
19    case Build.Invalid{owner,error}:(ctx,Refused{owner,Construction{error}})
20    case Build.Constructed{owner,undo}:returned(~I,~R,~Custom,~H,undo,Cap.owned_request(~H,~R,~Resource.Output<R>,~request,ctx,owner))

Uses (10)

Used by (1)