MCPcopy Index your code
hub / github.com/ewasm/ewasm-rust-api

github.com/ewasm/ewasm-rust-api @0.11.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.11.0 ↗ · + Follow
76 symbols 108 edges 8 files 69 documented · 91%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Extension points exported contracts — how you extend this code

From (Interface)
Basic type conversion traits. Unlike the native standard library, `U: From ` does not yet imply `T: Into `.
src/convert.rs
Into (Interface)
(no doc)
src/convert.rs

Core symbols most depended-on inside this repo

unsafe_alloc_buffer
called by 6
src/utils.rs
log
called by 5
src/lib.rs
unsafe_calldata_copy
called by 2
src/lib.rs
calldata_size
called by 2
src/lib.rs
unsafe_code_copy
called by 2
src/lib.rs
code_size
called by 2
src/lib.rs
unsafe_external_code_copy
called by 2
src/lib.rs
external_code_size
called by 2
src/lib.rs

Shape

Function 67
Class 4
Enum 3
Interface 2

Languages

Rust100%

Modules by API surface

src/lib.rs52 symbols
src/eth2.rs7 symbols
src/debug.rs7 symbols
src/types.rs4 symbols
src/utils.rs2 symbols
src/convert.rs2 symbols
src/bignum.rs2 symbols

For agents

$ claude mcp add ewasm-rust-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact