Expand description
§openstranded-plugin-api
Plugin SDK for OpenStranded — the core types and traits that all
WASM game plugins use to communicate with the engine and each other.
§Core types
Value: dynamic type for cross-plugin arguments and return valuesServiceError: typed errors for Service API callsService+ServiceRegistry: cross-plugin method call interfaceRegistry+RegistryEntry: in-memory content pack dataGameAPI: host-side API surface provided to pluginsContribution: declarative output from WASM pluginbuild()phaseApiVersion: compile-time baked version for compatibility checks
§Feature flags
ron(default): enablesparse_registry_dataandparse_registry_listtest-utils: enablesMockGameAPIfor testing
§WASM entry points
Every WASM plugin must export the following #[no_mangle] extern "C" functions:
| Export | Required | Called during |
|---|---|---|
plugin_api_version() -> ApiVersion | Yes | Load, before anything |
plugin_build(ctx) -> Vec<Contribution> | Yes | Registry phase |
plugin_ready(api) -> bool | No | Discovery phase |
plugin_finish(api) | No | Integration phase |
Modules§
Structs§
- ApiVersion
- Version of
openstranded-plugin-apibaked at compile time. - Registry
- All data from a Content Pack, grouped by domain (from manifest.toml).
- Registry
Entry - A single file from a Content Pack, indexed in the Registry.
- Resource
Decl - Describes a resource to be registered in the Bevy World.
- Service
Registry - Host-side registry of all registered services.
- System
Decl - Describes a system to be added to a Bevy schedule.
Enums§
- Contribution
- Declarative interface from WASM plugin to Host.
- LogLevel
- Log severity level.
- Service
Error - Errors that occur during Service API calls or Registry access.
- Value
- Dynamic type for Service API arguments and return values.
- Version
Mismatch - Version mismatch between a plugin and the engine.
Traits§
- GameAPI
- Host-side API surface provided to WASM plugins.
- Service
- Unified interface for cross-plugin calls.
Functions§
- parse_
registry_ data - Parse raw .ron bytes into a Value tree.
- parse_
registry_ list - Convenience wrapper: parse bytes as an array and return elements.