def with_namespace
import bendvy-ecs-core@0.1.0.3/world_io.bend as WorldIoimport Base
import bendvy-ecs-core@0.1.0.3/world.bend as W
21# Trusted integration constructor with a caller-supplied namespace. Rejects
22# reserved namespace values and returns the resource on refusal. Does not
23# allocate a unique namespace: caller must prevent collisions. Prefer create.
24def with_namespace(~S: Data,~C: Type,~R: Type,~E: Data,~empty: Unit -> C,+namespace: U32,resource: R) -> IO(Creation<S,C,R,E>):
25 IO.pure(Creation<S,C,R,E>,convert(~S,~C,~R,~E,W.create_checked(~S,~C,~R,~E,~empty,Bool.and(U32.is_lt(0,namespace),U32.is_lt(namespace,4294967295)),namespace,resource)))