def checked_store

bendvy-ecs-core@0.1.0.3 · execution_reservation_materialization.bend:125

import bendvy-ecs-core@0.1.0.3/execution_reservation_materialization.bend as ExecutionReservationMaterialization
import Base
import bendvy-ecs-core@0.1.0.3/execution_reservation_bundle.bend as Bundle
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout
import bendvy-ecs-core@0.1.0.3/change_tick.bend as Tick
import bendvy-ecs-core@0.1.0.3/world.bend as W
import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as A

125def checked_store(~S:Data,~R:Type,~E:Data,~layout:Layout.Layout,installTree:U32 -> Tick.Tick -> Layout.columns(~S,layout) -> Bundle.Payload(layout) -> Layout.columns(~S,layout) & Bundle.Payload(layout),allocator:A.Allocator,rest:Remainder<S,Layout.columns(~S,layout),R,E>,handle:W.Handle<S>,index:U32,tick:Tick.Tick,result:Layout.columns(~S,layout) & (Bundle.Payload(layout) & Maybe<&2,Bundle.Refusal>)) -> Bundle.Publication<S,Layout.columns(~S,layout),R,E,layout>:
126  match result:
127    case (store,(bundle,Some{reason})):Bundle.RefusedPublication{assembled(~S,~R,~E,~layout,allocator,rest,store),handle,bundle,reason}
128    case (store,(bundle,None{})):installed(~S,~R,~E,~layout,allocator,rest,handle,installTree(index,tick,store,bundle))

Uses (15)

Used by (1)