def observe_resource

bendvy-ecs-core@0.1.0.4 · world.bend:280

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

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

Uses (3)

Used by (22)