#sdk #wapc #webassembly #wasm #waxosuit

wapc-guest

Guest SDK for building waPC-compliant WebAssembly Modules

7 unstable releases (3 breaking)

new 0.4.0 Oct 15, 2020
0.3.2 Sep 9, 2020
0.3.1 Apr 14, 2020
0.3.0 Mar 30, 2020
0.1.1 Sep 19, 2019

#303 in WebAssembly

Download history 31/week @ 2020-06-27 26/week @ 2020-07-04 28/week @ 2020-07-11 45/week @ 2020-07-18 72/week @ 2020-07-25 141/week @ 2020-08-01 66/week @ 2020-08-08 113/week @ 2020-08-15 38/week @ 2020-08-22 86/week @ 2020-08-29 63/week @ 2020-09-05 91/week @ 2020-09-12 54/week @ 2020-09-19 62/week @ 2020-09-26 46/week @ 2020-10-03 57/week @ 2020-10-10

305 downloads per month
Used in 7 crates (4 directly)

Apache-2.0

10KB
182 lines

crates.io  travis  license

waPC Guest SDK

The waPC Guest SDK is used by Rust developers building workloads for the wasm32-unknown-unknown target that will conform to the waPC (WebAssembly Procedure Calls) specification.

This crate is used by waSCC as a foundation for its secure, dynamic binding of cloud capabilities on top of the waPC spec.

Example

extern crate wapc_guest as guest;

use guest::prelude::*;

#[no_mangle]
pub extern "C" fn wapc_init() {
  register_function("sample:Guest!Hello", hello_world);
}

fn hello_world(_msg: &[u8]) -> CallResult {
    let _res = host_call("myBinding", "sample:Host", "Call", b"hello")?;
    Ok(vec![])
}

lib.rs:

wapc-guest

The wapc-guest library provides WebAssembly module developers with access to a waPC-compliant host runtime. Each guest module registers function handlers with register_function. Inside this call handler, the guest module should check the operation of the delivered message and handle it accordingly, returning any binary payload in response.

Example

extern crate wapc_guest as guest;

use guest::prelude::*;

#[no_mangle]
pub extern "C" fn wapc_init() {
  register_function("sample:Guest!Hello", hello_world);
}

fn hello_world(
   _msg: &[u8]) -> CallResult {
   let _res = host_call("myBinding", "sample:Host", "Call", b"hello")?;
    Ok(vec![])
}

Dependencies

~12KB