#sdk #wapc #webassembly #wasm #waxosuit

waxosuit-guest

Guest SDK for building Waxosuit WebAssembly modules

4 releases

✓ Uses Rust 2018 edition

0.3.5 Oct 7, 2019
0.3.4 Oct 7, 2019
0.3.3 Sep 25, 2019

#2 in #waxosuit

49 downloads per month

Apache-2.0

23KB
362 lines

crates.io  travis  license

Waxosuit Guest SDK

The Waxosuit Guest SDK is used by Rust developers building cloud-native workloads for the wasm32-unknown-unknown target. Using Waxosuit to host your WebAssembly module allows you to stop worrying about all of the non-functional requirements and boilerplate that typically bogs down all of our development time and focus squarely on compiling the business logic in a portable, secure Wasm module.

For more documentation, tutorials, and examples, please check out the waxosuit website.

Example

extern crate waxosuit_guest as guest;

use guest::prelude::*;

call_handler!(handle_call);

pub fn handle_call(ctx: &CapabilitiesContext, operation: &str, msg: &[u8]) -> CallResult {
    match operation {
        http::OP_HANDLE_REQUEST => hello_world(ctx, msg),
        core::OP_HEALTH_REQUEST => Ok(vec![]),
        _ => Err("bad dispatch".into()),
    }     
}

fn hello_world(
   _ctx: &CapabilitiesContext,
   _msg: &[u8]) -> CallResult {
    Ok(vec![])
}

Dependencies

~2.4–4MB
~63K SLoC