SpatialOS SDK for Rust
This is an unoffical, unsupported, and untested integration of the SpatialOS SDK C API bindings with Rust. Improbable does not officially support Rust as a worker language.
This is still heavily WIP and should be treated as such. Progress can be seen in the Projects boards which define milestones and progress toward those milestones. When this reaches feature parity with the C API and has basic code generation in which all user facing APIs are safe, a crate will be published to crates.io.
Setup
- Clone this repository.
- Run
cargo run --bin download_sdk -- -d dependencies -s 13.3.1to download the C API dependencies. - Set the
SPATIAL_LIB_DIRenvironment variable to the location of the dependencies:export SPATIAL_LIB_DIR=$(pwd)/dependencies. - Run
cargo build
If these steps complete successfully, the spatialos-sdk crate has been built and linked successfully and can be used in user code.
Running the Example Project
To run the example project, you will need to:
- Build a release version of the RustWorker -
cargo build --example project-example --release. - Build the schema descriptor for Spatial -
./spatialos-sdk/examples/project-example/setup.sh - In two terminals:
- Navigate to the
spatialosdirectory and start spatial:cd spatialos-sdk/examples/project-example/spatialos/ && spatial local launch - Run the example project worker -
cargo run --example project-example -- receptionist --worker_type RustWorker
- Navigate to the