def observe_resource

bendvy-ecs-core@0.1.0.3 · world.bend:282

import bendvy-ecs-core@0.1.0.3/world.bend as World
import Base

282# Trusted resource-owner adapter: project returns the actual R with an Out owner
283# or value, then World is rebuilt. The signature does not prove projection purity
284# or allow duplicating affine resource contents.
285def observe_resource(~S: Data,~C: Type,~R: Type,~E: Data,~V: Type,~project: R -> R & V,world: World<S,C,R,E>) -> World<S,C,R,E> & V:
286  match world:
287    case World{+namespace,allocator,store,resource,+events,pending,+registrations,+nextSystemId,+clock,lifecycle}: observe_resource_finish(~S,~C,~R,~E,~V,project(resource),namespace,allocator,store,events,pending,registrations,nextSystemId,clock,lifecycle)

Uses (3)

Used by (3)