Skip to main content

Crate openstranded_common_wasmcontract

Crate openstranded_common_wasmcontract 

Source
Expand description

§openstranded-common-wasmcontract

Shared WASM contract types for OpenStranded — the core types and traits that both the engine and the plugin SDK use to communicate across the WASM boundary.

This crate is the single source of truth for all contract types:

  • Value: dynamic type for cross-plugin arguments and return values
  • ServiceError: typed errors for Service API calls
  • Service: cross-plugin method call interface (trait)
  • Registry: in-memory content pack data store
  • RegistryEntry: a single file from content pack (data + filename)
  • GameAPI: host-side API surface provided to plugins
  • Contribution: declarative output from WASM plugin build() phase
  • ApiVersion: compile-time baked version for compatibility checks
  • LogLevel: log severity level

§Feature flags

§Crate relationships

openstranded (engine)  ──┐
                         ├── openstranded-common-wasmcontract
openstranded-plugin-api ──┘

The engine and plugin-api both depend on this crate for shared types. The plugin-api crate re-exports everything and adds test utilities (MockGameAPI) and WASM entry point stubs.

Structs§

ApiVersion
Version of openstranded-common-wasmcontract baked at compile time.
Registry
All data from a Content Pack, grouped by domain (from manifest.toml).
RegistryEntry
A single file from a Content Pack, indexed in the Registry.
ResourceDecl
Describes a resource to be registered in the Bevy World.
SystemDecl
Describes a system to be added to a Bevy schedule.

Enums§

Contribution
Declarative interface from WASM plugin to Host.
LogLevel
Log severity level.
ServiceError
Errors that occur during Service API calls or Registry access.
Value
Dynamic type for Service API arguments and return values.
VersionMismatch
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 registry data bytes into a Value tree.
parse_registry_list
Convenience wrapper: parse bytes as an array and return elements.