10 releases (breaking)

✓ Uses Rust 2018 edition

0.11.0 Nov 27, 2019
0.10.0 Jul 1, 2019
0.9.0 May 28, 2019
0.7.0 Feb 14, 2019
0.5.0 Nov 29, 2018

#52 in WebAssembly

Download history 26/week @ 2020-01-25 13/week @ 2020-02-01 14/week @ 2020-02-08 20/week @ 2020-02-15 50/week @ 2020-02-22 7/week @ 2020-02-29 32/week @ 2020-03-07 19/week @ 2020-03-14 78/week @ 2020-03-21 23/week @ 2020-03-28 33/week @ 2020-04-04 66/week @ 2020-04-11 19/week @ 2020-04-18 14/week @ 2020-04-25 16/week @ 2020-05-02 17/week @ 2020-05-09

138 downloads per month

Apache-2.0 and MPL-2.0 licenses

34KB
772 lines

ewasm-rust-api

Build Version

This project aims to give a low-level and a high-level binding to ewasm from Rust.

Usage

Add the dependency, as usual:

[dependencies]
ewasm-api = "0.11"

Make sure the project is a library of cdylib type:

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

In your project, include the prelude:

use ewasm_api::prelude::*;

Additionally there is support for some macros to make creating contracts easier:

#[macro_use]
extern crate ewasm_api;

use ewasm_api::prelude::*;

fn entry() {
    // The actual contract code goes here.
}

ewasm_entry_point!(entry);

Other modules are available as well, outside of the prelude. Refer to the documentation for more info.

ewasm-rust-api builds with various feature sets:

  • default: Builds with wee_alloc as the global allocator and with the Rust standard library.
  • qimalloc: Builds with qimalloc as the global allocator.
  • debug: Exposes the debugging interface.
  • experimental: Exposes the experimental bignum system library API.

To enable specific features include the dependency as follows:

[dependencies.ewasm_api]
version = "0.11"
default-features = false
features = ["std", "qimalloc"]

Further documentation is available here.

Author(s)

Alex Beregszaszi, Jake Lang

License

Apache 2.0

Dependencies

~110KB