openstranded-common-wasmcontract 0.1.0

OpenStranded WASM contract types — shared between engine and plugin-api
Documentation
//! # 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
//!
//! - `parse` (default): enables [`parse_registry_data`] and [`parse_registry_list`]
//! - `std` (default): enables types that require the standard library
//!
//! ## Crate relationships
//!
//! ```text
//! 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.

mod value;
mod error;
mod service;
mod registry;
mod game_api;
mod contributions;
mod version;

// ── Re-exports ─────────────────────────────────────────────────────

pub use value::Value;
pub use error::ServiceError;
pub use service::Service;
pub use registry::{Registry, RegistryEntry};
#[cfg(feature = "parse")]
pub use registry::{parse_registry_data, parse_registry_list};
pub use game_api::{GameAPI, LogLevel};
pub use contributions::{Contribution, SystemDecl, ResourceDecl};
pub use version::{ApiVersion, VersionMismatch};