resistation 0.1.0

Rust SDK for Resistation, a WASM-powered little computing platform
Documentation
  • Coverage
  • 100%
    331 out of 331 items documented2 out of 177 items with examples
  • Size
  • Source code size: 109.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 12.63 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • legacy-resistation
resistation-0.1.0 has been yanked.

Resistation Rust SDK

This crate provides a library for building programs and games for the Resistation platform.

Resistation is a playful, WASM-powered platform for developing, sharing, and preserving little programs and games. This SDK offers all the necessary APIs to interact with the Resistation runtime environment.

For a complete guide on getting started with Resistation and the SDK, refer to the official guide.

Setup

To use the SDK, ensure that you have the necessary toolchain installed for compiling to WebAssembly (wasm32-unknown-unknown). You can install it with the following command:

rustup target add wasm32-unknown-unknown

Create a new Rust library project using Cargo, and then specify C dynamic library as create type and add the Resistation SDK as a dependency in your Cargo.toml:

[lib]
crate-type = ["cdylib"]

[dependencies]
resistation = "0.1"

To specify wasm32-unknown-unknown as your build target, create a .cargo/cargo.toml in your project's root with this content:

[build]
target = "wasm32-unknown-unknown"

Once set up, you can start building your program by importing the SDK's modules and using its APIs.

To run the program in Resistation on macOS, enter the following command on the terminal from your project's root folder:

> open -a Resistation target/wasm32-unknown-unknown/release/<program name>.wasm

On other Linux or Windows, use the following command instead:

> <path to Resistation AppImage or exe> --program=target/wasm32-unknown-unknown/release/<program name>.wasm

Examples

Here is a simple example to get started with a basic "Hello, World!" program for Resistation:

use resistation::println;

#[no_mangle]
extern "C" fn main() {
    println!("Hello, Resistation!");
}

This program uses the SDK's println! macro to display a message on the screen.

For more comprehensive examples and tutorials, refer to the official guide.

License

The source code for this crate is released under the 3-Clause BSD license.