Skip to main content

Module handle

Module handle 

Source
Expand description

Long-lived handle to the world runtime.

WorldHandle is the abstract interface plugins use to access world state from anywhere – captured in system closures, stored in plugin state. The trait itself does not require Send + Sync – concrete implementors that need to be shared across threads (e.g. the runtime World wrapped in Arc) satisfy these bounds independently. Distinct from WorldContext which extends this trait with dispatch-only methods (response queueing).

Implemented by the runtime World in basalt-world (production) and mock types in tests. Plugins receive an Arc<dyn WorldHandle> from PluginRegistrar::world.

Traits§

WorldHandle
Long-lived handle to the world runtime.