Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ewasm/ewasm-rust-api
Ewasm API for Rust
https://github.com/ewasm/ewasm-rust-api
ethereum ewasm rust
Last synced: 1 day ago
JSON representation
Ewasm API for Rust
- Host: GitHub
- URL: https://github.com/ewasm/ewasm-rust-api
- Owner: ewasm
- License: apache-2.0
- Created: 2018-06-25T23:44:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-17T05:33:06.000Z (over 3 years ago)
- Last Synced: 2024-11-07T22:09:58.639Z (9 days ago)
- Topics: ethereum, ewasm, rust
- Language: Rust
- Homepage:
- Size: 104 KB
- Stars: 104
- Watchers: 14
- Forks: 12
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ewasm-rust-api
![Build](https://circleci.com/gh/ewasm/ewasm-rust-api.svg?style=shield&circle-token=:circle-token)
![Version](https://img.shields.io/crates/v/ewasm-api.svg)This project aims to give a low-level and a high-level binding to ewasm from Rust.
# Usage
Add the dependency, as usual:
```toml
[dependencies]
ewasm-api = "0.11"
```Make sure the project is a library of `cdylib` type:
```toml
[lib]
crate-type = ["cdylib"]
```In your project, include the prelude:
```rust
use ewasm_api::prelude::*;
```Additionally there is support for some macros to make creating contracts easier:
```rust
#[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](https://github.com/wasmx/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:
```toml
[dependencies.ewasm_api]
version = "0.11"
default-features = false
features = ["std", "qimalloc"]
```
Further documentation is available [here](https://docs.rs/ewasm_api/).## Author(s)
Alex Beregszaszi, Jake Lang
## License
Apache 2.0