def register_writer

bendvy-ecs-core@0.1.0.4 · ordinary_event_declaration.bend:61

import bendvy-ecs-core@0.1.0.4/ordinary_event_declaration.bend as OrdinaryEventDeclaration
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/system.bend as Sys

61# Register a publishing system using declaration-derived access metadata.
62# A Read declaration returns RegistrationFailed with world retained; successful
63# registration returns the world and registry. No event is sent by registration.
64def register_writer(~S:Data,~C:Type,~R:Type,~E:Data,~A:Type,~Error:Data,~O:Type,~runner:W.World<S,C,R,E> -> A -> Sys.Outcome<W.World<S,C,R,E>,Error,O>,world:W.World<S,C,R,E>,+declaration:Declaration<S,E>,name:String) -> Sys.RegistrationResult<S,C,R,E,A,Error,O,runner>:
65  match declaration:
66    case Declaration{_,Read{}}:Sys.RegistrationFailed{world}
67    case Declaration{+domain,Write{}}:Sys.register(~S,~C,~R,~E,~A,~Error,~O,~runner,world,name,[access(~S,~E,Declaration{domain,Write{}})])

Uses (9)

Used by (1)