~/bend-docscommunity

world_io.bend relies on unsafe/foreign

raw source on the hub · import 0x67fd5084c1da4adc13317822045bb11f/world_io.bend as World_io

3 imports
import Base
import ./world.bend as W
import ./world_namespace.bend as F

Types

type Creation source · line 12 · raw

@S:Data -> @C:Type -> @R:Type -> @E:Data -> Type

Ordinary creation uses the checked host IO namespace allocator. Canonical linked Native execution and a shared JS realm are qualified separately. with_namespace/convert and raw World construction are trusted integration helpers. No language-wide constructor/authority confinement is claimed. Concrete World constructors remain a trusted schema/admin boundary. World creation outcome: Created owns the new World; Refused returns the caller's resource owner without constructing a usable World.

Templates

template convert source · line 16 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @created:0x67fd5084c1da4adc13317822045bb11f/world.Creation<S, C, R, E> -> Creation<S, C, R, E>

template with_namespace source · line 24 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-empty:(@_:Unit -> C) -> @+namespace:U32 -> @resource:R -> IO(Creation<S, C, R, E>)

Trusted integration constructor with a caller-supplied namespace. Rejects reserved namespace values and returns the resource on refusal. Does not allocate a unique namespace: caller must prevent collisions. Prefer create.

template create source · line 33 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-empty:(@_:Unit -> C) -> @resource:R -> IO(Creation<S, C, R, E>)

Create an independent World through the host IO namespace allocator. Consumes resource; Created returns its World, Refused returns resource. empty is trusted schema setup constructing component storage. Namespace uniqueness is scoped to the qualified host allocator realm/process, not arbitrary remote processes or raw constructors. Example: examples/scheduled-health/main.bend; identity: docs/parity/identity.md.