def constructed

bendvy-ecs-core@0.1.0.4 · decode_fallible_constructed_requests.bend:24

import bendvy-ecs-core@0.1.0.4/decode_fallible_constructed_requests.bend as DecodeFallibleConstructedRequests
import Base
import decode_construction.bend as Constructor
import bundle_construction.bend as Build
import decode_requests.bend as Request
import bundle_requests.bend as Commands
import capabilities.bend as Cap

24def constructed(~S:Data,~I:Type,~P:Type,~Custom:Data,~H:Type,~request:Cap.OwnedRequest<H,Request.Input<S,P>,Request.Output<S,P>>,ctx:H,operation:Commands.Operation<S>,result:Build.Construction<I,P,Constructor.Error<Custom>>) -> H & Output<S,I,P,Custom>:
25  match result:
26    case Build.Invalid{owner,error}:(ctx,Refused{Some{owner},Construction{error}})
27    case Build.Constructed{owner,undo}:returned(~S,~I,~P,~Custom,~H,undo,Cap.owned_request(~H,~Request.Input<S,P>,~Request.Output<S,P>,~request,ctx,Request.Input{operation,owner}))

Uses (13)

Used by (1)